瀏覽代碼

Check Auth: Updates for PHP 8.1

fusionate 2 年之前
父節點
當前提交
17f4c21c51
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      resources/check_auth.php

+ 2 - 2
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;