File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/Symfony/Component/HttpFoundation Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,8 @@ public function getScriptName()
377377 /**
378378 * Returns the path being requested relative to the executed script.
379379 *
380+ * The path info always starts with a /.
381+ *
380382 * Suppose this request is instantiated from /mysite on localhost:
381383 *
382384 * * http://localhost/mysite returns an empty string
@@ -417,6 +419,8 @@ public function getBasePath()
417419 /**
418420 * Returns the root url from which this request is executed.
419421 *
422+ * The base URL never ends with a /.
423+ *
420424 * This is similar to getBasePath(), except that it also includes the
421425 * script filename (e.g. index.php) if one exists.
422426 *
@@ -976,10 +980,10 @@ protected function preparePathInfo()
976980 $ baseUrl = $ this ->getBaseUrl ();
977981
978982 if (null === ($ requestUri = $ this ->getRequestUri ())) {
979- return '' ;
983+ return '/ ' ;
980984 }
981985
982- $ pathInfo = '' ;
986+ $ pathInfo = '/ ' ;
983987
984988 // Remove the query string from REQUEST_URI
985989 if ($ pos = strpos ($ requestUri , '? ' )) {
@@ -988,7 +992,7 @@ protected function preparePathInfo()
988992
989993 if ((null !== $ baseUrl ) && (false === ($ pathInfo = substr ($ requestUri , strlen ($ baseUrl ))))) {
990994 // If substr() returns false then PATH_INFO is set to an empty string
991- return '' ;
995+ return '/ ' ;
992996 } elseif (null === $ baseUrl ) {
993997 return $ requestUri ;
994998 }
You can’t perform that action at this time.
0 commit comments