From 9c6eab76f740171952aed5afb4b900cd02cfb8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Wed, 30 Mar 2022 15:07:27 +0200 Subject: [PATCH] Use sabre function directly rather than duplicating it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/AppFramework/Http/Request.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index f896b825f2d82..f77e79c4c8634 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -50,6 +50,7 @@ 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 @@ public function getRawPathInfo(): string { */ 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); } /**