Update announce.php

This commit is contained in:
Roman Kelesidis 2024-10-13 12:24:06 +07:00
commit 595784acd6

View file

@ -67,10 +67,16 @@ if (strlen($peer_id) !== 20) {
// Check for client ban // Check for client ban
if ($bb_cfg['client_ban']['enabled']) { if ($bb_cfg['client_ban']['enabled']) {
foreach ($bb_cfg['client_ban']['clients'] as $clientId => $reason) { foreach ($bb_cfg['client_ban']['clients'] as $clientId => $reason) {
if (($bb_cfg['client_ban']['only_allow_mode'] && !str_starts_with($peer_id, $clientId)) if ($bb_cfg['client_ban']['only_allow_mode']) {
|| str_starts_with($peer_id, $clientId) if (!str_starts_with($peer_id, $clientId)) {
) { msg_die('Your BitTorrent client has been banned!');
msg_die((empty($reason) || $bb_cfg['client_ban']['only_allow_mode']) ? 'Your BitTorrent client has been banned!' : $reason); } else {
break;
}
} else {
if (str_starts_with($peer_id, $clientId)) {
msg_die(empty($reason) ? 'Your BitTorrent client has been banned!' : $reason);
}
} }
} }
} }