]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use sabre function directly rather than duplicating it
authorCôme Chilliet <come.chilliet@nextcloud.com>
Wed, 30 Mar 2022 13:07:27 +0000 (15:07 +0200)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Tue, 26 Apr 2022 09:10:00 +0000 (11:10 +0200)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
lib/private/AppFramework/Http/Request.php

index f896b825f2d82d01a87b6a27368f614fa8ff6836..4079aa0595bb64f2a3d44e1a9072b3c3a51b043c 100644 (file)
@@ -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);
        }
 
        /**