Skip to content

Commit 111bddb

Browse files
authored
Merge pull request #3776 from maxtorete/patch-1
Slash baseUrl only from IRI beginning
2 parents 2a216dc + bf2cd50 commit 111bddb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Bridge/Symfony/Routing/Router.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ public function getRouteCollection()
7171
public function match($pathInfo)
7272
{
7373
$baseContext = $this->router->getContext();
74-
$pathInfo = str_replace($baseContext->getBaseUrl(), '', $pathInfo);
74+
$baseUrl = $baseContext->getBaseUrl();
75+
if ($baseUrl === substr($pathInfo, 0, \strlen($baseUrl))) {
76+
$pathInfo = substr($pathInfo, \strlen($baseUrl));
77+
}
7578

7679
$request = Request::create($pathInfo, 'GET', [], [], [], ['HTTP_HOST' => $baseContext->getHost()]);
7780
try {

0 commit comments

Comments
 (0)