File tree 2 files changed +17
-13
lines changed
src/Symfony/Component/HttpFoundation
2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -1836,15 +1836,9 @@ protected function prepareBaseUrl()
1836
1836
}
1837
1837
1838
1838
$ basename = basename ($ baseUrl );
1839
- if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ).'/ ' , '/ ' .$ basename .'/ ' )) {
1840
- // strip autoindex filename, for virtualhost based on URL path
1841
- $ baseUrl = \dirname ($ baseUrl ).'/ ' ;
1842
-
1843
- $ basename = basename ($ baseUrl );
1844
- if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ).'/ ' , '/ ' .$ basename .'/ ' )) {
1845
- // no match whatsoever; set it blank
1846
- return '' ;
1847
- }
1839
+ if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ), $ basename )) {
1840
+ // no match whatsoever; set it blank
1841
+ return '' ;
1848
1842
}
1849
1843
1850
1844
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
Original file line number Diff line number Diff line change @@ -1770,8 +1770,8 @@ public function getBaseUrlData()
1770
1770
'SCRIPT_NAME ' => '/foo/app.php ' ,
1771
1771
'PHP_SELF ' => '/foo/app.php ' ,
1772
1772
],
1773
- '/sub/foo ' ,
1774
- '/bar ' ,
1773
+ '' ,
1774
+ '/sub/foo/ bar ' ,
1775
1775
],
1776
1776
[
1777
1777
'/sub/foo/app.php/bar ' ,
@@ -1790,8 +1790,18 @@ public function getBaseUrlData()
1790
1790
'SCRIPT_NAME ' => '/foo/app2.phpx ' ,
1791
1791
'PHP_SELF ' => '/foo/app2.phpx ' ,
1792
1792
],
1793
- '/sub/foo ' ,
1794
- '/bar/baz ' ,
1793
+ '' ,
1794
+ '/sub/foo/bar/baz ' ,
1795
+ ],
1796
+ [
1797
+ '/foo/api/bar ' ,
1798
+ [
1799
+ 'SCRIPT_FILENAME ' => '/home/user/public_html/api/index.php ' ,
1800
+ 'SCRIPT_NAME ' => '/api/index.php ' ,
1801
+ 'PHP_SELF ' => '/api/index.php ' ,
1802
+ ],
1803
+ '' ,
1804
+ '/foo/api/bar ' ,
1795
1805
],
1796
1806
];
1797
1807
}
You can’t perform that action at this time.
0 commit comments