File tree 2 files changed +39
-3
lines changed
2 files changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -1848,9 +1848,15 @@ protected function prepareBaseUrl()
1848
1848
}
1849
1849
1850
1850
$ basename = basename ($ baseUrl );
1851
- if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ), $ basename )) {
1852
- // no match whatsoever; set it blank
1853
- return '' ;
1851
+ if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ).'/ ' , '/ ' .$ basename .'/ ' )) {
1852
+ // strip autoindex filename, for virtualhost based on URL path
1853
+ $ baseUrl = \dirname ($ baseUrl ).'/ ' ;
1854
+
1855
+ $ basename = basename ($ baseUrl );
1856
+ if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ).'/ ' , '/ ' .$ basename .'/ ' )) {
1857
+ // no match whatsoever; set it blank
1858
+ return '' ;
1859
+ }
1854
1860
}
1855
1861
1856
1862
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
Original file line number Diff line number Diff line change @@ -1763,6 +1763,36 @@ public function getBaseUrlData()
1763
1763
'/foo ' ,
1764
1764
'/bar+baz ' ,
1765
1765
],
1766
+ [
1767
+ '/sub/foo/bar ' ,
1768
+ [
1769
+ 'SCRIPT_FILENAME ' => '/home/John Doe/public_html/foo/app.php ' ,
1770
+ 'SCRIPT_NAME ' => '/foo/app.php ' ,
1771
+ 'PHP_SELF ' => '/foo/app.php ' ,
1772
+ ],
1773
+ '/sub/foo ' ,
1774
+ '/bar ' ,
1775
+ ],
1776
+ [
1777
+ '/sub/foo/app.php/bar ' ,
1778
+ [
1779
+ 'SCRIPT_FILENAME ' => '/home/John Doe/public_html/foo/app.php ' ,
1780
+ 'SCRIPT_NAME ' => '/foo/app.php ' ,
1781
+ 'PHP_SELF ' => '/foo/app.php ' ,
1782
+ ],
1783
+ '/sub/foo/app.php ' ,
1784
+ '/bar ' ,
1785
+ ],
1786
+ [
1787
+ '/sub/foo/bar/baz ' ,
1788
+ [
1789
+ 'SCRIPT_FILENAME ' => '/home/John Doe/public_html/foo/app2.phpx ' ,
1790
+ 'SCRIPT_NAME ' => '/foo/app2.phpx ' ,
1791
+ 'PHP_SELF ' => '/foo/app2.phpx ' ,
1792
+ ],
1793
+ '/sub/foo ' ,
1794
+ '/bar/baz ' ,
1795
+ ],
1766
1796
];
1767
1797
}
1768
1798
You can’t perform that action at this time.
0 commit comments