Merge pull request #19613 from nextcloud/enh/19537/undefined-index-password
Check that username and password are present.
This commit is contained in:
commit
42157337cf
10
lib/base.php
10
lib/base.php
|
@ -1077,10 +1077,12 @@ class OC {
|
|||
);
|
||||
foreach ($vars as $var) {
|
||||
if (isset($_SERVER[$var]) && preg_match('/Basic\s+(.*)$/i', $_SERVER[$var], $matches)) {
|
||||
list($name, $password) = explode(':', base64_decode($matches[1]), 2);
|
||||
$_SERVER['PHP_AUTH_USER'] = $name;
|
||||
$_SERVER['PHP_AUTH_PW'] = $password;
|
||||
break;
|
||||
$credentials = explode(':', base64_decode($matches[1]), 2);
|
||||
if (count($credentials) === 2) {
|
||||
$_SERVER['PHP_AUTH_USER'] = $credentials[0];
|
||||
$_SERVER['PHP_AUTH_PW'] = $credentials[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue