Skip to content

Commit

Permalink
Merge pull request #32236 from nextcloud/backport/31758/stable24
Browse files Browse the repository at this point in the history
[stable24] Use sabre function directly rather than duplicating it
  • Loading branch information
blizzz authored May 4, 2022
2 parents 15bd748 + 7b305c4 commit ee28bf8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
3 changes: 2 additions & 1 deletion build/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,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>
Expand Down
12 changes: 1 addition & 11 deletions lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -784,17 +784,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 \Sabre\HTTP\decodePath($pathInfo);
}

/**
Expand Down

0 comments on commit ee28bf8

Please sign in to comment.