File tree Expand file tree Collapse file tree 3 files changed +39
-24
lines changed Expand file tree Collapse file tree 3 files changed +39
-24
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
Original file line number Diff line number Diff line change @@ -1190,27 +1190,6 @@ private function parseQuotedString(string $yaml): ?string
1190
1190
}
1191
1191
1192
1192
return $ value ;
1193
-
1194
- for ($ i = 1 ; isset ($ yaml [$ i ]) && $ quotation !== $ yaml [$ i ]; ++$ i ) {
1195
- }
1196
-
1197
- // quoted single line string
1198
- if (isset ($ yaml [$ i ]) && $ quotation === $ yaml [$ i ]) {
1199
- return $ yaml ;
1200
- }
1201
-
1202
- $ lines = [$ yaml ];
1203
-
1204
- while ($ this ->moveToNextLine ()) {
1205
- for ($ i = 1 ; isset ($ this ->currentLine [$ i ]) && $ quotation !== $ this ->currentLine [$ i ]; ++$ i ) {
1206
- }
1207
-
1208
- $ lines [] = trim ($ this ->currentLine );
1209
-
1210
- if (isset ($ this ->currentLine [$ i ]) && $ quotation === $ this ->currentLine [$ i ]) {
1211
- break ;
1212
- }
1213
- }
1214
1193
}
1215
1194
1216
1195
private function lexInlineMapping (string $ yaml ): string
You can’t perform that action at this time.
0 commit comments