Fix redirect loop
This commit is contained in:
@@ -138,7 +138,11 @@ class TrackingMiddleware implements MiddlewareInterface
|
||||
$params = $request->getAttribute('normalizedParams');
|
||||
$query = $params->getQueryString();
|
||||
$path = $params->getRequestUri();
|
||||
if (preg_match('/(' . static::CODE_PATTERN . ')\/?$/i', $path)) {
|
||||
|
||||
if (!preg_match('/^(' . static::CODE_PATTERN . ')\/?$/i', $path)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$urlItems = GeneralUtility::trimExplode('/', $path, true);
|
||||
$code = array_pop($urlItems);
|
||||
$this->setCookie($code);
|
||||
@@ -153,9 +157,6 @@ class TrackingMiddleware implements MiddlewareInterface
|
||||
return $uri;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $code
|
||||
* @throws Exception
|
||||
|
||||
Reference in New Issue
Block a user