mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-01 21:21:24 +01:00
In wp_update_user(), make sure $userdata['ID'] is set before using it.
props tyxla. fixes #31097. Built from https://develop.svn.wordpress.org/trunk@31269 git-svn-id: http://core.svn.wordpress.org/trunk@31250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3982471a5c
commit
a47a5a1779
@ -1975,12 +1975,16 @@ function wp_update_user($userdata) {
|
||||
$userdata = $userdata->to_array();
|
||||
}
|
||||
|
||||
$ID = (int) $userdata['ID'];
|
||||
$ID = isset( $userdata['ID'] ) ? (int) $userdata['ID'] : 0;
|
||||
if ( ! $ID ) {
|
||||
return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );
|
||||
}
|
||||
|
||||
// First, get all of the original fields
|
||||
$user_obj = get_userdata( $ID );
|
||||
if ( ! $user_obj )
|
||||
if ( ! $user_obj ) {
|
||||
return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) );
|
||||
}
|
||||
|
||||
$user = $user_obj->to_array();
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31268';
|
||||
$wp_version = '4.2-alpha-31269';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user