diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index 48c7791939..36c245d7ae 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -1275,11 +1275,17 @@ function wp_insert_user( $userdata ) { } elseif ( $userdata instanceof WP_User ) { $userdata = $userdata->to_array(); } + // Are we updating or creating? if ( ! empty( $userdata['ID'] ) ) { $ID = (int) $userdata['ID']; $update = true; - $old_user_data = WP_User::get_data_by( 'id', $ID ); + $old_user_data = get_userdata( $ID ); + + if ( ! $old_user_data ) { + return new WP_Error( 'invalid_user_id', __( 'Invalid user ID.' ) ); + } + // hashed in wp_update_user(), plaintext if called directly $user_pass = $userdata['user_pass']; } else { diff --git a/wp-includes/version.php b/wp-includes/version.php index e15f4b980d..0cf4552b8a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35279'; +$wp_version = '4.4-alpha-35280'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.