Avoid ERR_TOO_MANY_REDIRECTS on template change

(cherry picked from commit 523afccb51f5e19f0da301e7f475e799d27d5303)
This commit is contained in:
slawkens 2020-06-03 20:01:26 +02:00
parent a0d38b1f36
commit 8e935e62be

View File

@ -25,7 +25,13 @@ if($config['template_allow_change'])
}
setSession('template', $template_name);
header('Location:' . getSession('last_uri'));
$newLocation = $lastUri = getSession('last_uri');
if($lastUri === $_SERVER['REQUEST_URI']) { // avoid ERR_TOO_MANY_REDIRECTS error in browsers
$newLocation = SERVER_URL;
}
header('Location:' . $newLocation);
}
}
else {