From b3b855d505156173c34ddb8698c180fa9644b738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Fri, 2 Feb 2024 16:18:54 +0100 Subject: [PATCH] exit on redirect --- lib/page.php | 1 - lib/router.php | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/page.php b/lib/page.php index f53bd8f..15107b4 100644 --- a/lib/page.php +++ b/lib/page.php @@ -43,7 +43,6 @@ function getPage($page_name = null): array|false|string $dynamic_page_file = $routerConfig["page_dir"] . $routerRequest["subdomain"] . "/" . $page_name . ".php"; $page_file = $routerConfig["page_dir"] . $routerRequest["subdomain"] . "/" . $page_name . ".html"; - echo $page_file; $skeleton = file_get_contents($routerConfig["template_dir"] . "skeleton.html"); $nav = file_get_contents($routerConfig["template_dir"] . "nav.html"); diff --git a/lib/router.php b/lib/router.php index 1558e68..ce0826f 100644 --- a/lib/router.php +++ b/lib/router.php @@ -51,7 +51,6 @@ function initRouter(): bool $routerRequest["page_name"]; // Redirect with default page name header("Location: $redirectAddress"); - exit(); } else{ if($_SERVER["REQUEST_METHOD"] == "POST"){ @@ -61,7 +60,7 @@ function initRouter(): bool $routerRequest["type"] = "page"; } } - + echo $needsRedirect; return !$needsRedirect; }