Browse Source

Merge pull request #31758 from nextcloud/fix/utf8-detection-fix

Use sabre function directly rather than duplicating it
tags/v25.0.0beta1
blizzz 2 years ago
parent
commit
033d527deb
No account linked to committer's email address
2 changed files with 3 additions and 12 deletions
  1. 2
    1
      build/psalm-baseline.xml
  2. 1
    11
      lib/private/AppFramework/Http/Request.php

+ 2
- 1
build/psalm-baseline.xml View File

@@ -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>

+ 1
- 11
lib/private/AppFramework/Http/Request.php View File

@@ -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);
}

/**

Loading…
Cancel
Save