Fix updating template menus on template change

This commit is contained in:
slawkens 2020-03-21 05:16:12 +01:00
parent ab94d0e752
commit df2d83b8a0

View File

@ -18,6 +18,12 @@ if($config['template_allow_change'])
if(!preg_match("/[^A-z0-9_\-]/", $template_name)) { // validate template if(!preg_match("/[^A-z0-9_\-]/", $template_name)) { // validate template
//setcookie('template', $template_name, 0, BASE_DIR . '/', $_SERVER["SERVER_NAME"]); //setcookie('template', $template_name, 0, BASE_DIR . '/', $_SERVER["SERVER_NAME"]);
$template_name = $_GET['template']; $template_name = $_GET['template'];
$cache = Cache::getInstance();
if($cache->enabled()) {
$cache->delete('template_menus');
}
setSession('template', $template_name); setSession('template', $template_name);
header('Location:' . getSession('last_uri')); header('Location:' . getSession('last_uri'));
} }