Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2012-09-25 21:49:42 +0400
committerLukas Reschke <lukas@statuscode.ch>2012-09-25 21:49:42 +0400
commit292d20595d95f634f1683845e237d01bfaa6ebd1 (patch)
tree953b04c87a4c2891f9d54da033b0964664c700a9 /lib
parent1e7ac8ba15b1f810efcb868d41bf7e30d4fa3aab (diff)
Passwords containing a ":" don't work with this explode
Thanks to mETz
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index 67f8e7702fc..f949e2a3d16 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -351,7 +351,7 @@ class OC{
//set http auth headers for apache+php-cgi work around
if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches))
{
- list($name, $password) = explode(':', base64_decode($matches[1]));
+ list($name, $password) = explode(':', base64_decode($matches[1]), 2);
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
}
@@ -359,7 +359,7 @@ class OC{
//set http auth headers for apache+php-cgi work around if variable gets renamed by apache
if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['REDIRECT_HTTP_AUTHORIZATION'], $matches))
{
- list($name, $password) = explode(':', base64_decode($matches[1]));
+ list($name, $password) = explode(':', base64_decode($matches[1]), 2);
$_SERVER['PHP_AUTH_USER'] = strip_tags($name);
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
}