Skip to content

Commit

Permalink
Use sabre function directly rather than duplicating it
Browse files Browse the repository at this point in the history
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc committed Mar 30, 2022
1 parent cf4c77e commit 9c6eab7
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions lib/private/AppFramework/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 9c6eab7

Please sign in to comment.