mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
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. Props MadtownLems, johnbillion, richard.tape, engahmeds3ed. Fixes #52003. git-svn-id: https://develop.svn.wordpress.org/trunk@49919 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -462,8 +462,8 @@ function wp_validate_application_password( $input_user ) {
|
||||
return $input_user;
|
||||
}
|
||||
|
||||
// Check that we're trying to authenticate
|
||||
if ( ! isset( $_SERVER['PHP_AUTH_USER'] ) ) {
|
||||
// Both $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] must be set in order to attempt authentication.
|
||||
if ( ! isset( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW'] ) ) {
|
||||
return $input_user;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user