summaryrefslogtreecommitdiffstats
path: root/3rdparty/Sabre/HTTP/BasicAuth.php
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/Sabre/HTTP/BasicAuth.php')
-rwxr-xr-x[-rw-r--r--]3rdparty/Sabre/HTTP/BasicAuth.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/3rdparty/Sabre/HTTP/BasicAuth.php b/3rdparty/Sabre/HTTP/BasicAuth.php
index 35c22d22dc3..a747cc6a31b 100644..100755
--- a/3rdparty/Sabre/HTTP/BasicAuth.php
+++ b/3rdparty/Sabre/HTTP/BasicAuth.php
@@ -4,11 +4,11 @@
* HTTP Basic Authentication handler
*
* Use this class for easy http authentication setup
- *
+ *
* @package Sabre
- * @subpackage HTTP
- * @copyright Copyright (C) 2007-2011 Rooftop Solutions. All rights reserved.
- * @author Evert Pot (http://www.rooftopsolutions.nl/)
+ * @subpackage HTTP
+ * @copyright Copyright (C) 2007-2012 Rooftop Solutions. All rights reserved.
+ * @author Evert Pot (http://www.rooftopsolutions.nl/)
* @license http://code.google.com/p/sabredav/wiki/License Modified BSD License
*/
class Sabre_HTTP_BasicAuth extends Sabre_HTTP_AbstractAuth {
@@ -22,7 +22,7 @@ class Sabre_HTTP_BasicAuth extends Sabre_HTTP_AbstractAuth {
*
* If nothing was supplied, 'false' will be returned
*
- * @return mixed
+ * @return mixed
*/
public function getUserPass() {
@@ -33,12 +33,18 @@ class Sabre_HTTP_BasicAuth extends Sabre_HTTP_AbstractAuth {
}
- // Most other webservers
+ // Most other webservers
$auth = $this->httpRequest->getHeader('Authorization');
+ // Apache could prefix environment variables with REDIRECT_ when urls
+ // are passed through mod_rewrite
+ if (!$auth) {
+ $auth = $this->httpRequest->getRawServerValue('REDIRECT_HTTP_AUTHORIZATION');
+ }
+
if (!$auth) return false;
- if (strpos(strtolower($auth),'basic')!==0) return false;
+ if (strpos(strtolower($auth),'basic')!==0) return false;
return explode(':', base64_decode(substr($auth, 6)));