From 253cceb44c24318e179e5ea5d1934b23120491dd Mon Sep 17 00:00:00 2001 From: mercury Date: Thu, 21 Nov 2024 12:13:02 +0400 Subject: [PATCH] fix analyze ip autoban --- app/bot.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/bot.php b/app/bot.php index 8f355dd..277cb89 100644 --- a/app/bot.php +++ b/app/bot.php @@ -4362,15 +4362,19 @@ DNS-over-HTTPS with IP: if (preg_match('~(\d+\.\d+\.\d+\.\d+)~', $l, $m)) { if ($reverse xor preg_match($regexp, $l)) { if (is_array($ranges)) { + $flag = true; foreach ($ranges as $range) { - if (!$this->ipInRange($m[1], $range)) { - $ret[$m[1]][] = [ - 'title' => $title, - 'log' => $l, - ]; + if ($this->ipInRange($m[1], $range)) { + $flag = false; break; } } + if ($flag) { + $ret[$m[1]][] = [ + 'title' => $title, + 'log' => $l, + ]; + } } else { if ($this->ipInRange($m[1], $ranges)) { $ret[$m[1]][] = [