diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-30 16:07:27 +0300 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-04-26 12:10:00 +0300 |
commit | 9132ed8ef1dcc42c67cf5d0fa299d45606a1dfaa (patch) | |
tree | 017f92a52014be69f874c6b5e27d552aa0b9f462 /lib | |
parent | 8a3f8b07a8b8b4f7dd618ddc42d2d4698d30a31a (diff) |
Use sabre function directly rather than duplicating it
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/AppFramework/Http/Request.php | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index f896b825f2d..4079aa0595b 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -50,6 +50,7 @@ use OCP\IConfig; use OCP\IRequest; use OCP\IRequestId; use OCP\Security\ICrypto; +use function Sabre\HTTP\decodePathSegment; /** * Class for accessing variables in the request. @@ -784,17 +785,7 @@ class Request implements \ArrayAccess, \Countable, IRequest { */ public function getPathInfo() { $pathInfo = $this->getRawPathInfo(); - // following is taken from \Sabre\HTTP\URLUtil::decodePathSegment - $pathInfo = rawurldecode($pathInfo); - $encoding = mb_detect_encoding($pathInfo, ['UTF-8', 'ISO-8859-1']); - - switch ($encoding) { - case 'ISO-8859-1': - $pathInfo = utf8_encode($pathInfo); - } - // end copy - - return $pathInfo; + return decodePathSegment($pathInfo); } /** |