summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-25 14:21:51 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-25 17:41:44 +0100
commit411a78b509d037d4d70ab308af0d924664a44fd9 (patch)
tree3cba34e69d3b8f679f37368929406de1c6c887ae /lib
parent880769976bbc8c75186c89268c78bc40efb80998 (diff)
downloadnextcloud-server-411a78b509d037d4d70ab308af0d924664a44fd9.tar.gz
nextcloud-server-411a78b509d037d4d70ab308af0d924664a44fd9.zip
handle duplicate slashes in case of reverse proxy configuration
Conflicts: tests/lib/request.php
Diffstat (limited to 'lib')
-rwxr-xr-xlib/request.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/request.php b/lib/request.php
index df33217f95d..dbdd21fbf7b 100755
--- a/lib/request.php
+++ b/lib/request.php
@@ -135,7 +135,10 @@ class OC_Request {
* @returns string Path info or false when not found
*/
public static function getRawPathInfo() {
- $path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']));
+ $requestUri = $_SERVER['REQUEST_URI'];
+ // remove too many leading slashes - can be caused by reverse proxy configuration
+ $requestUri = '/' . ltrim($requestUri, '/');
+ $path_info = substr($requestUri, strlen($_SERVER['SCRIPT_NAME']));
// Remove the query string from REQUEST_URI
if ($pos = strpos($path_info, '?')) {
$path_info = substr($path_info, 0, $pos);