Skip to content

Commit cf42295

Browse files
authored
Fix infinite loop for unsecure upgrading to secure
1 parent 6550241 commit cf42295

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Plugin/App/Request/StorePathInfoValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,13 @@ public function beforeGetValidStoreCode(Subject $subject, Http $request, string
3636
$storeCode = $this->resolveStoreCode($request, $pathInfo);
3737
$pathInfo = $storeCode === '' ? $pathInfo : $storeCode;
3838
}
39-
$this->stack--;
4039

4140
return [$request, $pathInfo];
4241
}
4342

4443
public function afterGetValidStoreCode(Subject $subject, ?string $store, Http $request, string $path = ''): ?string
4544
{
46-
if (!$this->config->isStoreInPath() && $this->config->isBaseUrlResolverEnabled()) {
45+
if ($this->stack === 1 && !$this->config->isStoreInPath() && $this->config->isBaseUrlResolverEnabled()) {
4746
try {
4847
$store = $this->storeRepository->getActiveStoreByCode(
4948
$this->resolveStoreCode($request, $path)
@@ -52,6 +51,7 @@ public function afterGetValidStoreCode(Subject $subject, ?string $store, Http $r
5251
$store = null;
5352
}
5453
}
54+
$this->stack--;
5555

5656
return $store;
5757
}

0 commit comments

Comments
 (0)