From 38a44317afc1e777023ee072ccba6b98682f7fc8 Mon Sep 17 00:00:00 2001 From: mercury Date: Sun, 11 Jun 2023 16:35:55 +0400 Subject: [PATCH] fix calc ip when add peer wg --- app/bot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/bot.php b/app/bot.php index d8eba92..6410b43 100644 --- a/app/bot.php +++ b/app/bot.php @@ -2819,7 +2819,7 @@ DNS-over-HTTPS with IP: $bitmask = $ipnet[1]; if (!empty($conf['peers'])) { foreach ($conf['peers'] as $k => $v) { - $ips[] = ip2long(explode('/', $v['AllowedIPs'])[0]); + $ips[] = ip2long(explode('/', $v['AllowedIPs'] ?: $v['# AllowedIPs'])[0]); } } $ip_count = (1 << (32 - $bitmask)) - count($ips) - 1;