Spáchanie #216fdsaf

This commit is contained in:
Richard Mikloš 2024-01-20 20:04:56 +01:00
parent 9fdd7d72dc
commit 09c32d1be2

@ -50,7 +50,6 @@ $page_data = include_ob($page_file);
$output = file_get_contents("$template_dir/skeleton.html"); $output = file_get_contents("$template_dir/skeleton.html");
$output = str_replace('<template name="navigation">', $nav, $output); $output = str_replace('<template name="navigation">', $nav, $output);
$output = str_replace('<template name="page content">', $page_data, $output);
if (isset($_SESSION['user_id'])) { if (isset($_SESSION['user_id'])) {
$hash = md5(strtolower(trim($_SESSION['user_email']))); $hash = md5(strtolower(trim($_SESSION['user_email'])));
@ -61,6 +60,7 @@ if (isset($_SESSION['user_id'])) {
$page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data); $page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data);
} }
$page_regex = '/<!--PAGENAME=(.*?)-->/s'; $page_regex = '/<!--PAGENAME=(.*?)-->/s';
if(preg_match($page_regex, $page_data, $matches)){ if(preg_match($page_regex, $page_data, $matches)){
@ -72,6 +72,7 @@ else{
} }
$output = str_replace('<template name="page name">', $page_name, $output); $output = str_replace('<template name="page name">', $page_name, $output);
$output = str_replace('<template name="page content">', $page_data, $output);
echo $output; echo $output;
?> ?>