Browse Source

Check Auth: Updates for PHP 8.1

fusionate 2 năm trước cách đây
mục cha
commit
17f4c21c51
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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;