Pluggable Auth: When setting new passwords for users trim any leading or trailing space to match what we do when we test passwords.

Fixes #23494


git-svn-id: http://core.svn.wordpress.org/trunk@23814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Westwood 2013-03-27 14:15:13 +00:00
parent d174e5c7ef
commit b85cb06509

View File

@ -1565,7 +1565,7 @@ if ( !function_exists('wp_set_password') ) :
function wp_set_password( $password, $user_id ) {
global $wpdb;
$hash = wp_hash_password($password);
$hash = wp_hash_password( trim( $password ) );
$wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id) );
wp_cache_delete($user_id, 'users');