diff --git a/wp-includes/user.php b/wp-includes/user.php index 00f27a8f29..5f98b1e478 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -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(); diff --git a/wp-includes/version.php b/wp-includes/version.php index 47c600cb5c..7085cc0cef 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.