Commit 123ea26e authored by Kevin Ditscheid's avatar Kevin Ditscheid

[BUGFIX] Prevent an endless redirect loop if page id not accessible

parent 4ab35d03
......@@ -129,7 +129,7 @@ class RoutingService {
if ($resultArray) {
foreach ($resultArray as $redirect) {
$appendParameters = '';
if ($requestParameters !== NULL && $redirect['redirect_url_parameters']) {
if ($requestParameters !== NULL && $requestParameters !== '' && $redirect['redirect_url_parameters']) {
$appendParameters = '?' . $requestParameters;
}
......@@ -161,6 +161,12 @@ class RoutingService {
if (\is_numeric($destinationUrl)) {
// Get destination url from controller if target is a page id
$redirectUri = $this->getUrlFromPageId($destinationUrl) . $appendParameters;
if ($redirectUri === '') {
// the page either does not exist or isn't accessible, drop out
$this->getTypoScriptFrontendController()->pageNotFoundAndExit(
'The page with id #' . $destinationUrl . ' could not be found!'
);
}
} else {
$redirectUri = $destinationUrl . $appendParameters;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment