From b70a56de852689de31eedb46eaf88fe0a8a169db Mon Sep 17 00:00:00 2001 From: jeroen Date: Sun, 21 Aug 2022 12:54:56 +0200 Subject: [PATCH] Update functions: Check the debug mode after the direct access check --- functions.inc.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/functions.inc.php b/functions.inc.php index 38f1ed7..5f6b1d7 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -7,21 +7,23 @@ // // File: functions.inc.php // -if ($CONF['debug'] == 'true') { - ini_set('display_errors', 1); - ini_set('display_startup_errors', 1); - error_reporting(E_ALL); - mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); -} else { - ini_set('display_errors', 0); - ini_set('display_startup_errors', 0); -} if(preg_match("/functions.inc.php/", $_SERVER['SCRIPT_NAME'])) { header("Location: login.php"); - exit; + die(); } +if ($CONF['debug'] == 'true') { + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + error_reporting(E_ALL); + mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); +} else { + ini_set('display_errors', 0); + ini_set('display_startup_errors', 0); +} + + $version = "1.0.0"; // @@ -33,7 +35,7 @@ function check_session() { session_start(); if (!isset($_SESSION['sessid']['username'])) { header("Location: login.php"); - exit; + die(); } $SESSID_USERNAME = $_SESSION['sessid']['username']; return $SESSID_USERNAME; @@ -43,7 +45,7 @@ function check_user_session() { session_start(); if (!isset($_SESSION['userid']['username'])) { header("Location: login.php"); - exit; + die(); } $USERID_USERNAME = $_SESSION['userid']['username']; return $USERID_USERNAME;