From 2d6f2745a62e185ea7d6a172f4c8cfffc638b6c6 Mon Sep 17 00:00:00 2001 From: Miraty Date: Tue, 28 Mar 2023 00:18:37 +0200 Subject: [PATCH] Fix syntax and error --- http-errors/lib.php | 2 +- router.php | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/http-errors/lib.php b/http-errors/lib.php index 82e98bd..b3ee751 100644 --- a/http-errors/lib.php +++ b/http-errors/lib.php @@ -1,7 +1,7 @@ $_SERVER[\'SERVER_NAME\']'); +if (in_array($_SERVER['SERVER_NAME'], CONF['common']['public_domains'], true) !== true) + exit('The current $_SERVER[\'SERVER_NAME\'] is not allowed in configuration.'); +define('SERVER_NAME', $_SERVER['SERVER_NAME']); + const SESSION_COOKIE_NAME = 'servnest-session-key'; function startSession() { session_start([ @@ -119,12 +125,6 @@ if (isset($_SESSION['id'])) { } } -if (isset($_SERVER['SERVER_NAME']) !== true) - output(500, 'Missing $_SERVER[\'SERVER_NAME\']'); -if (in_array($_SERVER['SERVER_NAME'], CONF['common']['public_domains'], true) !== true) - output(500, 'The current server name is not allowed in configuration.'); -define('SERVER_NAME', $_SERVER['SERVER_NAME']); - function displayFinalMessage($data) { if (isset($data['final_message'])) { echo $data['final_message'];