File tree 1 file changed +7
-3
lines changed
src/Symfony/Component/HttpFoundation
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,8 @@ public function getScriptName()
377
377
/**
378
378
* Returns the path being requested relative to the executed script.
379
379
*
380
+ * The path info always starts with a /.
381
+ *
380
382
* Suppose this request is instantiated from /mysite on localhost:
381
383
*
382
384
* * http://localhost/mysite returns an empty string
@@ -417,6 +419,8 @@ public function getBasePath()
417
419
/**
418
420
* Returns the root url from which this request is executed.
419
421
*
422
+ * The base URL never ends with a /.
423
+ *
420
424
* This is similar to getBasePath(), except that it also includes the
421
425
* script filename (e.g. index.php) if one exists.
422
426
*
@@ -976,10 +980,10 @@ protected function preparePathInfo()
976
980
$ baseUrl = $ this ->getBaseUrl ();
977
981
978
982
if (null === ($ requestUri = $ this ->getRequestUri ())) {
979
- return '' ;
983
+ return '/ ' ;
980
984
}
981
985
982
- $ pathInfo = '' ;
986
+ $ pathInfo = '/ ' ;
983
987
984
988
// Remove the query string from REQUEST_URI
985
989
if ($ pos = strpos ($ requestUri , '? ' )) {
@@ -988,7 +992,7 @@ protected function preparePathInfo()
988
992
989
993
if ((null !== $ baseUrl ) && (false === ($ pathInfo = substr ($ requestUri , strlen ($ baseUrl ))))) {
990
994
// If substr() returns false then PATH_INFO is set to an empty string
991
- return '' ;
995
+ return '/ ' ;
992
996
} elseif (null === $ baseUrl ) {
993
997
return $ requestUri ;
994
998
}
You can’t perform that action at this time.
0 commit comments