$userdata should be null for anonymous requests. props MattyRob. props duck_ for the unit test. fixes #19769 for trunk.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-03-02 20:59:30 +00:00
parent 9852aaa561
commit 1729a14278
1 changed files with 7 additions and 6 deletions

View File

@ -936,7 +936,7 @@ function setup_userdata($for_user_id = '') {
else
$user = new WP_User($for_user_id);
$userdata = $user;
$userdata = null;
$user_ID = (int) $user->ID;
$user_level = (int) isset($user->user_level) ? $user->user_level : 0;
@ -945,11 +945,12 @@ function setup_userdata($for_user_id = '') {
return;
}
$user_login = $user->user_login;
$user_email = $user->user_email;
$user_url = $user->user_url;
$user_pass_md5 = md5($user->user_pass);
$user_identity = $user->display_name;
$userdata = $user;
$user_login = $user->user_login;
$user_email = $user->user_email;
$user_url = $user->user_url;
$user_pass_md5 = md5( $user->user_pass );
$user_identity = $user->display_name;
}
/**