allow template pages to be placed in templates dir

This commit is contained in:
slawkens 2023-02-07 22:46:35 +01:00
parent 60a854e5fd
commit a84c92e007

View File

@ -335,11 +335,15 @@ if($load_it)
)) . $content; )) . $content;
} }
} else { } else {
$file = SYSTEM . 'pages/' . $page . '.php'; $file = TEMPLATES . $template_name . '/pages/' . $page . '.php';
if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page)) if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page))
{ {
$page = '404'; $file = SYSTEM . 'pages/' . $page . '.php';
$file = SYSTEM . 'pages/404.php'; if(!@file_exists($file) || preg_match('/[^A-z0-9_\-]/', $page))
{
$page = '404';
$file = SYSTEM . 'pages/404.php';
}
} }
} }