App Passwords: Only attempt auth if the username and password are set.

Previously, only the username was checked which caused a PHP warning in some server setups, for instance Shibboleth SSO, where the server only populates the PHP_AUTH_USER field.

This brings the changes from [49919] to the 5.6 branch.

Props MadtownLems, johnbillion, richard.tape, engahmeds3ed, TimothyBlynJacobs.

Fixes #52003.

Built from https://develop.svn.wordpress.org/branches/5.6@50045


git-svn-id: http://core.svn.wordpress.org/branches/5.6@49746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
whyisjake 2021-01-28 00:32:58 +00:00
parent 8cf894710b
commit 5e3f9c3b31
2 changed files with 3 additions and 3 deletions

View File

@ -461,8 +461,8 @@ function wp_validate_application_password( $input_user ) {
return $input_user; return $input_user;
} }
// Check that we're trying to authenticate // Both $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] must be set in order to attempt authentication.
if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) ) { if ( ! isset( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) {
return $input_user; return $input_user;
} }

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.6.1-alpha-50044'; $wp_version = '5.6.1-alpha-50045';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.