From a121abd910db2073551a4c4af8916667b0543e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Fri, 2 Feb 2024 16:22:36 +0100 Subject: [PATCH] exit on redirect --- lib/router.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/router.php b/lib/router.php index bb19dec..d2f90e3 100644 --- a/lib/router.php +++ b/lib/router.php @@ -51,6 +51,7 @@ function initRouter(): bool $routerRequest["page_name"]; // Redirect with default page name header("Location: $redirectAddress"); + return false; } else{ if($_SERVER["REQUEST_METHOD"] == "POST"){ @@ -59,14 +60,8 @@ function initRouter(): bool if(empty($routerRequest["type"])){ $routerRequest["type"] = "page"; } + return true; } - if ($needsRedirect){ - echo "yes"; - } - else{ - echo "no"; - } - return !$needsRedirect; }