Skip to content

Commit 994cb7f

Browse files
authored
Do not override path info if we cannot process it
1 parent 5eb94c3 commit 994cb7f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Plugin/App/Request/StorePathInfoValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,18 @@ public function __construct(
3030
public function beforeGetValidStoreCode(Subject $subject, Http $request, string $pathInfo = ''): array
3131
{
3232
if ($this->config->isBaseUrlResolverEnabled()) {
33+
$originalPathInfo = $pathInfo;
3334
$uri = strtok($request->getUriString(), '?') . '/';
3435
if ($uri !== false) {
3536
if ($pathInfo === '') {
3637
$pathInfo = parse_url($uri, PHP_URL_PATH);
3738
if ($pathInfo === false) {
38-
return [$request, $pathInfo];
39+
return [$request, $originalPathInfo];
3940
}
4041
$pathInfo = strtok($pathInfo, '/');
4142
}
4243
$pathInfo = $pathInfo === false ? $this->resolveByWebUrl($uri) : $this->resolveByLinkUrl($uri);
44+
$pathInfo = $pathInfo === '' ? $originalPathInfo : $pathInfo;
4345
}
4446
}
4547

0 commit comments

Comments
 (0)