summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-04-29 13:05:57 +0200
committerGitHub <noreply@github.com>2022-04-29 13:05:57 +0200
commit033d527debcd2d6f7370a6113614bf3da9d8c693 (patch)
treecee800d8f50ead18c7dcd354d5bab14d18b356a3
parent8367b02785acd920db244ecb745517820ed9ff91 (diff)
parent9cfc70d189eb6532a99bf461e2814d75676111c8 (diff)
downloadnextcloud-server-033d527debcd2d6f7370a6113614bf3da9d8c693.tar.gz
nextcloud-server-033d527debcd2d6f7370a6113614bf3da9d8c693.zip
Merge pull request #31758 from nextcloud/fix/utf8-detection-fix
Use sabre function directly rather than duplicating it
-rw-r--r--build/psalm-baseline.xml3
-rw-r--r--lib/private/AppFramework/Http/Request.php12
2 files changed, 3 insertions, 12 deletions
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index d08312ad789..4f4e18e1f90 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -2537,7 +2537,8 @@
<RedundantCondition occurrences="1">
<code>\is_array($params)</code>
</RedundantCondition>
- <UndefinedFunction occurrences="1">
+ <UndefinedFunction occurrences="2">
+ <code>\Sabre\HTTP\decodePath($pathInfo)</code>
<code>\Sabre\Uri\split($scriptName)</code>
</UndefinedFunction>
</file>
diff --git a/lib/private/AppFramework/Http/Request.php b/lib/private/AppFramework/Http/Request.php
index f896b825f2d..010d889070e 100644
--- a/lib/private/AppFramework/Http/Request.php
+++ b/lib/private/AppFramework/Http/Request.php
@@ -784,17 +784,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 \Sabre\HTTP\decodePath($pathInfo);
}
/**