Browse Source

Bug fixed unset the cidr variable

FusionPBX 2 năm trước cách đây
mục cha
commit
4e447d07e1
1 tập tin đã thay đổi với 7 bổ sung4 xóa
  1. 7 4
      resources/cidr.php

+ 7 - 4
resources/cidr.php

@@ -27,11 +27,14 @@
 //check the domain cidr range 
 	if (isset($_SESSION['domain']["cidr"]) && !defined('STDIN')) {
 		$found = false;
-		foreach($_SESSION['domain']["cidr"] as $cidr) {
-			if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
-				$found = true;
-				break;
+		if (!empty($_SESSION['domain']["cidr"])) {
+			foreach($_SESSION['domain']["cidr"] as $cidr) {
+				if (check_cidr($cidr, $_SERVER['REMOTE_ADDR'])) {
+					$found = true;
+					break;
+				}
 			}
+			unset($cidr);
 		}
 		if (!$found) {
 			echo "access denied";