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