From 595784acd68d9b5388631c09cfb22b09e534235d Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 13 Oct 2024 12:24:06 +0700 Subject: [PATCH] Update announce.php --- bt/announce.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bt/announce.php b/bt/announce.php index ed70c1ec7..ac91c0f1d 100644 --- a/bt/announce.php +++ b/bt/announce.php @@ -67,10 +67,16 @@ if (strlen($peer_id) !== 20) { // Check for client ban if ($bb_cfg['client_ban']['enabled']) { foreach ($bb_cfg['client_ban']['clients'] as $clientId => $reason) { - if (($bb_cfg['client_ban']['only_allow_mode'] && !str_starts_with($peer_id, $clientId)) - || str_starts_with($peer_id, $clientId) - ) { - msg_die((empty($reason) || $bb_cfg['client_ban']['only_allow_mode']) ? 'Your BitTorrent client has been banned!' : $reason); + if ($bb_cfg['client_ban']['only_allow_mode']) { + if (!str_starts_with($peer_id, $clientId)) { + msg_die('Your BitTorrent client has been banned!'); + } else { + break; + } + } else { + if (str_starts_with($peer_id, $clientId)) { + msg_die(empty($reason) ? 'Your BitTorrent client has been banned!' : $reason); + } } } }