mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-22 17:16:06 +00:00
Merge branch 'master' into 'master'
Basic Auth Bugfix
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).
See merge request !12
This commit is contained in:
commit
71db9008af
@ -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