mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Make wp_setcookie() and wp_clearcookie() replaceable.
git-svn-id: http://svn.automattic.com/wordpress/trunk@2340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
973fea010e
commit
1d6d4c6d93
@ -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