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

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


git-svn-id: https://develop.svn.wordpress.org/trunk@25709 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2013-10-07 13:53:09 +00:00
parent f4227afa2b
commit fc1438c8bc
2 changed files with 29 additions and 3 deletions

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');