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 @@ -1907,9 +1907,15 @@ protected function prepareBaseUrl()
1907
1907
}
1908
1908
1909
1909
$ basename = basename ($ baseUrl );
1910
- if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ), $ basename )) {
1911
- // no match whatsoever; set it blank
1912
- return '' ;
1910
+ if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ).'/ ' , '/ ' .$ basename .'/ ' )) {
1911
+ // strip autoindex filename, for virtualhost based on URL path
1912
+ $ baseUrl = \dirname ($ baseUrl ).'/ ' ;
1913
+
1914
+ $ basename = basename ($ baseUrl );
1915
+ if (empty ($ basename ) || !strpos (rawurldecode ($ truncatedRequestUri ).'/ ' , '/ ' .$ basename .'/ ' )) {
1916
+ // no match whatsoever; set it blank
1917
+ return '' ;
1918
+ }
1913
1919
}
1914
1920
1915
1921
// If using mod_rewrite or ISAPI_Rewrite strip the script filename
Original file line number Diff line number Diff line change @@ -1785,6 +1785,36 @@ public function getBaseUrlData()
1785
1785
'/foo ' ,
1786
1786
'/bar+baz ' ,
1787
1787
],
1788
+ [
1789
+ '/sub/foo/bar ' ,
1790
+ [
1791
+ 'SCRIPT_FILENAME ' => '/home/John Doe/public_html/foo/app.php ' ,
1792
+ 'SCRIPT_NAME ' => '/foo/app.php ' ,
1793
+ 'PHP_SELF ' => '/foo/app.php ' ,
1794
+ ],
1795
+ '/sub/foo ' ,
1796
+ '/bar ' ,
1797
+ ],
1798
+ [
1799
+ '/sub/foo/app.php/bar ' ,
1800
+ [
1801
+ 'SCRIPT_FILENAME ' => '/home/John Doe/public_html/foo/app.php ' ,
1802
+ 'SCRIPT_NAME ' => '/foo/app.php ' ,
1803
+ 'PHP_SELF ' => '/foo/app.php ' ,
1804
+ ],
1805
+ '/sub/foo/app.php ' ,
1806
+ '/bar ' ,
1807
+ ],
1808
+ [
1809
+ '/sub/foo/bar/baz ' ,
1810
+ [
1811
+ 'SCRIPT_FILENAME ' => '/home/John Doe/public_html/foo/app2.phpx ' ,
1812
+ 'SCRIPT_NAME ' => '/foo/app2.phpx ' ,
1813
+ 'PHP_SELF ' => '/foo/app2.phpx ' ,
1814
+ ],
1815
+ '/sub/foo ' ,
1816
+ '/bar/baz ' ,
1817
+ ],
1788
1818
];
1789
1819
}
1790
1820
You can’t perform that action at this time.
0 commit comments