summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/request.php2
-rw-r--r--tests/lib/request.php1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/request.php b/lib/private/request.php
index 3c33dfc340a..3bf7d94d9cf 100644
--- a/lib/private/request.php
+++ b/lib/private/request.php
@@ -278,6 +278,8 @@ class OC_Request {
$requestUri = '/' . ltrim($requestUri, '/');
}
+ $requestUri = preg_replace('%/{2,}%', '/', $requestUri);
+
// Remove the query string from REQUEST_URI
if ($pos = strpos($requestUri, '?')) {
$requestUri = substr($requestUri, 0, $pos);
diff --git a/tests/lib/request.php b/tests/lib/request.php
index ea3722b90a6..dd6d1e47cd5 100644
--- a/tests/lib/request.php
+++ b/tests/lib/request.php
@@ -84,6 +84,7 @@ class Test_Request extends \Test\TestCase {
array('/core/ajax/translations.php', '/core/ajax/translations.php', 'index.php'),
array('/core/ajax/translations.php', '//core/ajax/translations.php', '/index.php'),
array('/core/ajax/translations.php', '/oc/core/ajax/translations.php', '/oc/index.php'),
+ array('/core/ajax/translations.php', '/oc//index.php/core/ajax/translations.php', '/oc/index.php'),
array('/1', '/oc/core/1', '/oc/core/index.php'),
);
}