]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove reading PATH_INFO from server variable 984/head
authorLukas Reschke <lukas@statuscode.ch>
Fri, 19 Aug 2016 12:46:20 +0000 (14:46 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Fri, 19 Aug 2016 12:48:13 +0000 (14:48 +0200)
Having two code paths for this is unreliable and can lead to bugs. Also, in some cases Apache isn't setting the PATH_INFO variable when mod_rewrite is used.

Fixes https://github.com/nextcloud/server/issues/983

lib/private/AppFramework/Http/Request.php
tests/lib/AppFramework/Http/RequestTest.php

index 2139ad05c2e001f0fc458a163fb18b40157fa3c5..46122f880cc05a479cb1325a492bdb4967cb8fe9 100644 (file)
@@ -700,10 +700,6 @@ class Request implements \ArrayAccess, \Countable, IRequest {
         * @return string|false Path info or false when not found
         */
        public function getPathInfo() {
-               if(isset($this->server['PATH_INFO'])) {
-                       return $this->server['PATH_INFO'];
-               }
-
                $pathInfo = $this->getRawPathInfo();
                // following is taken from \Sabre\HTTP\URLUtil::decodePathSegment
                $pathInfo = rawurldecode($pathInfo);
index 8df81afeb3b222fbcf1a85913aa66257c91a79ec..a3433e558d85de41caa165ed100246e0c27a3db2 100644 (file)
@@ -1063,22 +1063,6 @@ class RequestTest extends \Test\TestCase {
                $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
         * @expectedExceptionMessage The requested uri(/foo.php) cannot be processed by the script '/var/www/index.php')