Sack encoding fix from hgfischer. fixes #2977

git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-07-27 07:11:46 +00:00
parent 0977aef844
commit 8b62852b61
1 changed files with 2 additions and 2 deletions

View File

@ -245,9 +245,9 @@ function check_ajax_referer() {
$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie'])); // AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = substr(strstr($tasty, '='), 1);
$user = urldecode(substr(strstr($tasty, '='), 1)); // Nasty double encoding
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = substr(strstr($tasty, '='), 1);
$pass = urldecode(substr(strstr($tasty, '='), 1));
}
if ( wp_login( $user, $pass, true ) )
return true;