Merge pull request #984 from nextcloud/dont-read-server-variable
Remove reading PATH_INFO from server variable
This commit is contained in:
commit
8fbec6aae3
|
@ -700,10 +700,6 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
||||||
* @return string|false Path info or false when not found
|
* @return string|false Path info or false when not found
|
||||||
*/
|
*/
|
||||||
public function getPathInfo() {
|
public function getPathInfo() {
|
||||||
if(isset($this->server['PATH_INFO'])) {
|
|
||||||
return $this->server['PATH_INFO'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$pathInfo = $this->getRawPathInfo();
|
$pathInfo = $this->getRawPathInfo();
|
||||||
// following is taken from \Sabre\HTTP\URLUtil::decodePathSegment
|
// following is taken from \Sabre\HTTP\URLUtil::decodePathSegment
|
||||||
$pathInfo = rawurldecode($pathInfo);
|
$pathInfo = rawurldecode($pathInfo);
|
||||||
|
|
|
@ -1063,22 +1063,6 @@ class RequestTest extends \Test\TestCase {
|
||||||
$this->assertSame('www.owncloud.org', self::invokePrivate($request, 'getOverwriteHost'));
|
$this->assertSame('www.owncloud.org', self::invokePrivate($request, 'getOverwriteHost'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetPathInfoWithSetEnv() {
|
|
||||||
$request = new Request(
|
|
||||||
[
|
|
||||||
'server' => [
|
|
||||||
'PATH_INFO' => 'apps/files/',
|
|
||||||
]
|
|
||||||
],
|
|
||||||
$this->secureRandom,
|
|
||||||
$this->config,
|
|
||||||
$this->csrfTokenManager,
|
|
||||||
$this->stream
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->assertSame('apps/files/', $request->getPathInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException \Exception
|
* @expectedException \Exception
|
||||||
* @expectedExceptionMessage The requested uri(/foo.php) cannot be processed by the script '/var/www/index.php')
|
* @expectedExceptionMessage The requested uri(/foo.php) cannot be processed by the script '/var/www/index.php')
|
||||||
|
|
Loading…
Reference in New Issue