From 281751e26406c59cc8991bbed99b7b072fc38331 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 1/4] 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..4079aa0595bb6 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); } /** From 03132f71c096a1200cc0886cd534bd1127cee51e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Wed, 30 Mar 2022 16:31:54 +0200 Subject: [PATCH 2/4] Trying without the use 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php index 4079aa0595bb6..010d889070e19 100644 --- a/lib/private/AppFramework/Http/Request.php +++ b/lib/private/AppFramework/Http/Request.php @@ -50,7 +50,6 @@ use OCP\IRequest; use OCP\IRequestId; use OCP\Security\ICrypto; -use function Sabre\HTTP\decodePathSegment; /** * Class for accessing variables in the request. @@ -785,7 +784,7 @@ public function getRawPathInfo(): string { */ public function getPathInfo() { $pathInfo = $this->getRawPathInfo(); - return decodePathSegment($pathInfo); + return \Sabre\HTTP\decodePath($pathInfo); } /** From 71cb301f97a4b580293d3957f03748d5d7b1c857 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 25 Apr 2022 16:05:19 +0200 Subject: [PATCH 3/4] Update psalm baseline for Sabre decodePath Signed-off-by: Vincent Petry --- build/psalm-baseline.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 863226922d88b..94c7e0a5b40a0 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -2542,7 +2542,8 @@ \is_array($params) - + + \Sabre\HTTP\decodePath($pathInfo) \Sabre\Uri\split($scriptName) From 7b305c4c77e02b0616b5eeb5200a165ea6def38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 2 May 2022 11:44:37 +0200 Subject: [PATCH 4/4] Restart CI