Skip to content

Commit cc420bc

Browse files
authored
Fix malformated uri (during build)
1 parent 97b6917 commit cc420bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Plugin/App/Request/StorePathInfoValidator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public function beforeGetValidStoreCode(Subject $subject, Http $request, string
3232
if ($this->config->isEnabled()) {
3333
$uri = explode('?', $request->getUriString())[0] . '/';
3434
if ($pathInfo === '') {
35-
$pathInfo = strtok(parse_url($uri, PHP_URL_PATH), '/');
35+
$pathInfo = parse_url($uri, PHP_URL_PATH);
36+
if ($pathInfo !== false) {
37+
$pathInfo = strtok($pathInfo, '/');
38+
}
3639
}
3740
$pathInfo = $pathInfo === false ? $this->resolveByWebUrl($uri) : $this->resolveByLinkUrl($uri, $pathInfo);
3841
}

0 commit comments

Comments
 (0)