mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 12:50:28 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@35116 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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'] );
|
||||
|
||||
Reference in New Issue
Block a user