diff --git a/Plugin/App/Request/StorePathInfoValidator.php b/Plugin/App/Request/StorePathInfoValidator.php index 12965fa..1e3dbb5 100644 --- a/Plugin/App/Request/StorePathInfoValidator.php +++ b/Plugin/App/Request/StorePathInfoValidator.php @@ -12,6 +12,8 @@ use Magento\Store\Model\Store; use Opengento\StorePathUrl\Model\Config; +use function explode; + class StorePathInfoValidator { public function __construct( @@ -22,7 +24,7 @@ public function __construct( public function beforeGetValidStoreCode(Subject $subject, Http $request, string $pathInfo = ''): array { if ($pathInfo !== '' && $this->config->isEnabled()) { - $uri = $request->getUriString(); + $uri = explode('?', $request->getUriString())[0] . '/'; /** @var Store $store */ foreach ($this->storeRepository->getList() as $store) { if ($store->getId() && str_starts_with($uri, $store->getBaseUrl())) {