Skip to content

Commit 10a3fb3

Browse files
committed
fix original/too loose matching
1 parent 02b65f3 commit 10a3fb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpFoundation/Request.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1944,11 +1944,11 @@ protected function prepareBaseUrl()
19441944
$truncatedRequestUri = substr($requestUri, 0, $pos);
19451945
}
19461946

1947-
if (empty(basename($baseUrl)) || !strpos(rawurldecode($truncatedRequestUri), basename($baseUrl))) {
1947+
if (empty(basename($baseUrl)) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.basename($baseUrl).'/')) {
19481948
// strip autoindex filename, for virtualhost based on URL path
19491949
$baseUrl = \dirname($baseUrl).'/';
19501950

1951-
if (empty(basename($baseUrl)) || !strpos(rawurldecode($truncatedRequestUri), basename($baseUrl))) {
1951+
if (empty(basename($baseUrl)) || !strpos(rawurldecode($truncatedRequestUri).'/', '/'.basename($baseUrl).'/')) {
19521952
// no match whatsoever; set it blank
19531953
return '';
19541954
}

0 commit comments

Comments
 (0)