Commit c13bf8d8 authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #13552 from owncloud/request-uri-double-slash

Remove duplicated slashes from the requested url
parents dc4ceda2 0b9f7642
......@@ -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);
......
......@@ -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'),
);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment