mirror of
https://github.com/nextcloud/server.git
synced 2026-04-20 22:00:39 -04:00
Use sabre function directly rather than duplicating it
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
8a3f8b07a8
commit
9132ed8ef1
1 changed files with 2 additions and 11 deletions
|
|
@ -50,6 +50,7 @@ use OCP\IConfig;
|
|||
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 @@ 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 decodePathSegment($pathInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue