ExternalBackend: Don't authenticate a user if `REMOTE_USER` is empty

This commit is contained in:
Johannes Meyer 2019-12-05 15:13:02 +01:00
parent 52df0eb399
commit 668ae38497
1 changed files with 2 additions and 2 deletions

View File

@ -70,11 +70,11 @@ class ExternalBackend implements UserBackendInterface
public static function getRemoteUser($variable = 'REMOTE_USER')
{
$username = getenv($variable);
if ($username !== false) {
if (! empty($username)) {
return $username;
}
if (array_key_exists($variable, $_SERVER)) {
if (array_key_exists($variable, $_SERVER) && ! empty($_SERVER[$variable])) {
return $_SERVER[$variable];
}
}