From dec61c3833aa59bbdf07f3e43e380d8e9af399b8 Mon Sep 17 00:00:00 2001 From: fusionate Date: Tue, 27 Jun 2023 02:31:25 +0000 Subject: [PATCH] Check Auth: Updates for PHP 8.1 --- resources/check_auth.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/check_auth.php b/resources/check_auth.php index b77be242df..ef9ee901fc 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -58,7 +58,7 @@ $result = $auth->validate(); //if not authorized - if (!$_SESSION['authorized']) { + if (empty($_SESSION['authorized']) || !$_SESSION['authorized']) { //log the failed auth attempt to the system to the syslog server openlog('FusionPBX', LOG_NDELAY, LOG_AUTH); @@ -66,7 +66,7 @@ closelog(); //redirect the user to the login page - $target_path = ($_REQUEST["path"] != '') ? $_REQUEST["path"] : $_SERVER["PHP_SELF"]; + $target_path = !empty($_REQUEST["path"]) ? $_REQUEST["path"] : $_SERVER["PHP_SELF"]; message::add($text['message-authentication_failed'], 'negative'); header("Location: ".PROJECT_PATH."/?path=".urlencode($target_path)); exit;