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