summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2020-02-23 18:53:17 +0100
committerDaniel Kesselberg <mail@danielkesselberg.de>2020-02-23 18:53:17 +0100
commit56efd687abf4551d782114175e0ff2567e16aad2 (patch)
tree8fb67b202320ed06a7fb2514df950a05664d9568 /lib/base.php
parentbaf386b5d8c8f96993b5c61457281f1921c11ac0 (diff)
downloadnextcloud-server-56efd687abf4551d782114175e0ff2567e16aad2.tar.gz
nextcloud-server-56efd687abf4551d782114175e0ff2567e16aad2.zip
Check that username and password are present.
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/base.php b/lib/base.php
index b0991307dda..1d944685654 100644
--- a/lib/base.php
+++ b/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;
+ }
}
}
}