mirror of
https://github.com/nextcloud/server.git
synced 2026-04-02 15:45:38 -04:00
Merge pull request #13552 from owncloud/request-uri-double-slash
Remove duplicated slashes from the requested url
This commit is contained in:
commit
c13bf8d820
2 changed files with 3 additions and 0 deletions
|
|
@ -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'),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue