Prevent a PHP notice from appearing on `wp-login.php?action=postpass` when there's no `$_POST['post_password']` parameter. Redirects to the referer if there is one (if there isn't one it'll just exit with a blank screen; no need for a user-friendly error message here).

Fixes #34160
Props iamfriendly

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


git-svn-id: http://core.svn.wordpress.org/trunk@34874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2015-10-07 14:30:25 +00:00
parent 3baa1336ec
commit 2d745fabe3
2 changed files with 6 additions and 1 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34908';
$wp_version = '4.4-alpha-34909';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -472,6 +472,11 @@ $interim_login = isset($_REQUEST['interim-login']);
switch ($action) {
case 'postpass' :
if ( ! array_key_exists( 'post_password', $_POST ) ) {
wp_safe_redirect( wp_get_referer() );
exit();
}
require_once ABSPATH . WPINC . '/class-phpass.php';
$hasher = new PasswordHash( 8, true );