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:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-25 17:21:51 +0400
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-25 20:41:44 +0400
commit411a78b509d037d4d70ab308af0d924664a44fd9 (patch)
tree3cba34e69d3b8f679f37368929406de1c6c887ae /lib
parent880769976bbc8c75186c89268c78bc40efb80998 (diff)
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);