File tree Expand file tree Collapse file tree 2 files changed +39
-3
lines changed Expand file tree Collapse file tree 2 files changed +39
-3
lines changed Original file line number Diff line number Diff line change @@ -1907,9 +1907,15 @@ protected function prepareBaseUrl()
19071907 }
19081908
19091909 $ 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+ }
19131919 }
19141920
19151921 // 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()
17851785 '/foo ' ,
17861786 '/bar+baz ' ,
17871787 ],
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+ ],
17881818 ];
17891819 }
17901820
You can’t perform that action at this time.
0 commit comments