Move the trim() from wp_set_password() to inside wp_hash_password().

props rpattillo, joehoyle.
fixes #24973. see #23494.

Built from https://develop.svn.wordpress.org/trunk@25709


git-svn-id: http://core.svn.wordpress.org/trunk@25623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-10-07 13:54:10 +00:00
parent d2f06ecf48
commit e2413462de

View File

@ -1456,7 +1456,7 @@ function wp_hash_password($password) {
$wp_hasher = new PasswordHash(8, true);
}
return $wp_hasher->HashPassword($password);
return $wp_hasher->HashPassword( trim( $password ) );
}
endif;
@ -1603,7 +1603,7 @@ if ( !function_exists('wp_set_password') ) :
function wp_set_password( $password, $user_id ) {
global $wpdb;
$hash = wp_hash_password( trim( $password ) );
$hash = wp_hash_password( $password );
$wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id) );
wp_cache_delete($user_id, 'users');