mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-07-28 13:09:24 +00:00
Bugfix on Basic Auth username/password split.
Basic Auth uses a colon (":") to separate the username and
password values. Using the php 'explode' function on this
string without limiting the number of substrings returned
can truncate the users password if it contains a colon.
By limiting the explode to 2, we get back the username and
whatever else is left as the password (hence not truncated).
This commit is contained in:
parent
39f1d04abe
commit
356c995aa3
@ -106,7 +106,7 @@ class HTTPAuthSession {
|
||||
if (isset($_SERVER['AUTHORIZATION']) && !empty($_SERVER['AUTHORIZATION'])) {
|
||||
list ($type, $cred) = explode(" ", $_SERVER['AUTHORIZATION']);
|
||||
if ($type == 'Basic') {
|
||||
list ($user, $pass) = explode(":", base64_decode($cred));
|
||||
list ($user, $pass) = explode(":", base64_decode($cred), 2);
|
||||
$_SERVER['PHP_AUTH_USER'] = $user;
|
||||
$_SERVER['PHP_AUTH_PW'] = $pass;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user