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:
Pascal Birchler
2017-04-06 18:00:16 +00:00
parent 74e7dab932
commit ca0aa133ff
5 changed files with 7 additions and 1 deletions
+1
View File
@@ -793,6 +793,7 @@ function post_password_required( $post = null ) {
return apply_filters( 'post_password_required', true, $post );
}
require_once ABSPATH . WPINC . '/class-phpass.php';
$hasher = new PasswordHash( 8, true );
$hash = wp_unslash( $_COOKIE[ 'wp-postpass_' . COOKIEHASH ] );