From 45fcc412ab22c2783430e99bfad7092cda7b8779 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 5 May 2025 18:42:45 +0300 Subject: [PATCH] Update displaying_torrent.php --- library/attach_mod/displaying_torrent.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index 426bce393..a4364d750 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -463,10 +463,12 @@ if ($tor_reged && $tor_info) { } $peerCountry = $lang['UNKNOWN']; - if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_peer_country')) { - if ($infoByIP = infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])) { - if (!empty($infoByIP['countryCode'])) { - $peerCountry = render_flag($infoByIP['countryCode'], false); + if ($bb_cfg['ip2country_settings']['enabled']) { + if (IS_AM || $peer['user_id'] == $userdata['user_id'] || !bf($peer['user_opt'], 'user_opt', 'user_hide_peer_country')) { + if ($infoByIP = infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])) { + if (!empty($infoByIP['countryCode'])) { + $peerCountry = render_flag($infoByIP['countryCode'], false); + } } } }