diff --git a/src/Common/Utils.php b/src/Common/Utils.php index e0b47bf92b37523d51aac092c372b0d6dc58b189..3f1497622bcee12dd7139a66f8c5fa9355085eea 100644 --- a/src/Common/Utils.php +++ b/src/Common/Utils.php @@ -315,14 +315,14 @@ class Utils $ips = json_decode($ips, true); if ($ips === null) return null; $ipLong = ip2long($ip); - $ret = true; + $ret = false; foreach ($ips as $ipNet) { - $ipArr = explode($ipNet, '/'); + $ipArr = explode('/', $ipNet); $p1 = $ipArr[0]; $p2 = $ipArr[1] ?? 24; $net = ip2long($p1) >> $p2; - if ($ipLong >> $p2 !== $net) { - $ret = false; + if ($ipLong >> $p2 === $net) { + $ret = true; break; } }