Skip to content

Commit 807354b

Browse files
committed
Allows paths with non-ending '/'
1 parent f5bbe6e commit 807354b

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
@@ -12,6 +12,8 @@
1212
use Magento\Store\Model\Store;
1313
use Opengento\StorePathUrl\Model\Config;
1414

15+
use function explode;
16+
1517
class StorePathInfoValidator
1618
{
1719
public function __construct(
@@ -22,7 +24,7 @@ public function __construct(
2224
public function beforeGetValidStoreCode(Subject $subject, Http $request, string $pathInfo = ''): array
2325
{
2426
if ($pathInfo !== '' && $this->config->isEnabled()) {
25-
$uri = $request->getUriString();
27+
$uri = explode('?', $request->getUriString())[0] . '/';
2628
/** @var Store $store */
2729
foreach ($this->storeRepository->getList() as $store) {
2830
if ($store->getId() && str_starts_with($uri, $store->getBaseUrl())) {

0 commit comments

Comments
 (0)