From fc842e33c9d56df3cda38f2fa325d0e84a370503 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 13 Oct 2015 02:48:24 +0000 Subject: [PATCH] Users: when passing a `WP_User` instance to `wp_update_user()`, ensure that the user password is not accidentally double-hashed. This is terrifying. Adds unit tests. Props tbcorr, salcode. Fixes #28435. Built from https://develop.svn.wordpress.org/trunk@35116 git-svn-id: http://core.svn.wordpress.org/trunk@35081 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user-functions.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index db87cd49a8..a79d1e8448 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -1602,7 +1602,7 @@ function wp_update_user($userdata) { // Escape data pulled from DB. $user = add_magic_quotes( $user ); - if ( ! empty($userdata['user_pass']) ) { + if ( ! empty( $userdata['user_pass'] ) && $userdata['user_pass'] !== $user_obj->user_pass ) { // If password is changing, hash it now $plaintext_pass = $userdata['user_pass']; $userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 7837698819..d8a3d16ad8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35115'; +$wp_version = '4.4-alpha-35116'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.