mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
Load: Only load PasswordHash class when needed.
This reverts [38371] which loaded `class-phpass.php` early in `wp-settings.php` and in turn caused backward compatibility problems. Props DavidAnderson, ketuchetan. Fixes #39445. git-svn-id: https://develop.svn.wordpress.org/trunk@40387 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1805,6 +1805,7 @@ function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' )
|
||||
|
||||
// Now insert the key, hashed, into the DB.
|
||||
if ( empty( $wp_hasher ) ) {
|
||||
require_once ABSPATH . WPINC . '/class-phpass.php';
|
||||
$wp_hasher = new PasswordHash( 8, true );
|
||||
}
|
||||
$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
|
||||
@@ -2085,6 +2086,7 @@ function wp_hash_password($password) {
|
||||
global $wp_hasher;
|
||||
|
||||
if ( empty($wp_hasher) ) {
|
||||
require_once( ABSPATH . WPINC . '/class-phpass.php');
|
||||
// By default, use the portable hash from phpass
|
||||
$wp_hasher = new PasswordHash(8, true);
|
||||
}
|
||||
@@ -2144,6 +2146,7 @@ function wp_check_password($password, $hash, $user_id = '') {
|
||||
// If the stored hash is longer than an MD5, presume the
|
||||
// new style phpass portable hash.
|
||||
if ( empty($wp_hasher) ) {
|
||||
require_once( ABSPATH . WPINC . '/class-phpass.php');
|
||||
// By default, use the portable hash from phpass
|
||||
$wp_hasher = new PasswordHash(8, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user