瀏覽代碼

Authentication [Class] - Updates for PHP 8.1

fusionate 2 年之前
父節點
當前提交
6d8c8995aa
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      core/authentication/resources/classes/authentication.php

+ 3 - 3
core/authentication/resources/classes/authentication.php

@@ -169,7 +169,7 @@ class authentication {
 			user_logs::add($result);
 
 		//debug information
-			if ($debug) {
+			if (!empty($debug)) {
 				if ($row["authorized"]) {
 					echo "authorized: true\n";
 				}
@@ -179,7 +179,7 @@ class authentication {
 			}
 
 		//user is authorized - get user settings, check user cidr
-			if ($authorized) {
+			if (!empty($authorized)) {
 
 				//set a session variable to indicate authorized is set to true
 					$_SESSION['authorized'] = true;
@@ -403,7 +403,7 @@ class authentication {
 			} //authorized true
 
 		//return the result
-			return $result;
+			return $result ?? false;
 	}
 
 	/**