mirror of
git://develop.git.wordpress.org/
synced 2025-02-24 08:33:35 +01:00
Preinitialize WP_User::$data to an object in the event an empty user object is created. Avoids a "Creating default object from empty value" PHP Warning.
Fixes #28019 git-svn-id: https://develop.svn.wordpress.org/trunk@31049 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
44c0c4a9cd
commit
8cce0f1607
@ -422,7 +422,7 @@ class WP_User {
|
||||
*
|
||||
* @since 2.0.0
|
||||
* @access private
|
||||
* @var array
|
||||
* @var object
|
||||
*/
|
||||
var $data;
|
||||
|
||||
@ -521,13 +521,17 @@ class WP_User {
|
||||
$id = 0;
|
||||
}
|
||||
|
||||
if ( $id )
|
||||
if ( $id ) {
|
||||
$data = self::get_data_by( 'id', $id );
|
||||
else
|
||||
} else {
|
||||
$data = self::get_data_by( 'login', $name );
|
||||
}
|
||||
|
||||
if ( $data )
|
||||
if ( $data ) {
|
||||
$this->init( $data, $blog_id );
|
||||
} else {
|
||||
$this->data = new stdClass;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user