Make wp_setcookie() and wp_clearcookie() replaceable.
git-svn-id: https://develop.svn.wordpress.org/trunk@2340 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
8c0bda2b91
commit
fe2c881868
@ -1752,6 +1752,7 @@ function add_magic_quotes($array) {
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !function_exists('wp_setcookie') ) :
|
||||||
function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') {
|
function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '') {
|
||||||
if ( !$already_md5 )
|
if ( !$already_md5 )
|
||||||
$password = md5( md5($password) ); // Double hash the password in the cookie.
|
$password = md5( md5($password) ); // Double hash the password in the cookie.
|
||||||
@ -1777,12 +1778,14 @@ function wp_setcookie($username, $password, $already_md5 = false, $home = '', $s
|
|||||||
setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $sitecookiepath);
|
setcookie('wordpresspass_'. $cookiehash, $password, time() + 31536000, $sitecookiepath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
endif;
|
||||||
|
|
||||||
|
if ( !function_exists('wp_clearcookie') ) :
|
||||||
function wp_clearcookie() {
|
function wp_clearcookie() {
|
||||||
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
|
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
|
||||||
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
|
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, COOKIEPATH);
|
||||||
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
|
setcookie('wordpressuser_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
|
||||||
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
|
setcookie('wordpresspass_' . COOKIEHASH, ' ', time() - 31536000, SITECOOKIEPATH);
|
||||||
}
|
}
|
||||||
|
endif;
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user