Skip to content

Commit

Permalink
Allows paths with non-ending '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-kl1 committed Mar 27, 2024
1 parent f5bbe6e commit 807354b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Plugin/App/Request/StorePathInfoValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Magento\Store\Model\Store;
use Opengento\StorePathUrl\Model\Config;

use function explode;

class StorePathInfoValidator
{
public function __construct(
Expand All @@ -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())) {
Expand Down

0 comments on commit 807354b

Please sign in to comment.