From 1e5b93d2c072c5c35feef7567b3fcdb4b3597935 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sun, 4 May 2025 12:27:13 +0300 Subject: [PATCH] misc: Minor improvements (#1892) --- library/attach_mod/displaying_torrent.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/attach_mod/displaying_torrent.php b/library/attach_mod/displaying_torrent.php index 0a780e16d..4d698ee09 100644 --- a/library/attach_mod/displaying_torrent.php +++ b/library/attach_mod/displaying_torrent.php @@ -464,11 +464,9 @@ 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 ($port !== false && $ip !== false) { - if ($infoByIP = infoByIP($ip, $port)) { - if (isset($infoByIP['countryCode'])) { - $peerCountry = render_flag($infoByIP['countryCode']); - } + if ($infoByIP = infoByIP((!empty($peer['ipv6']) ? $peer['ipv6'] : $peer['ip']), $peer['port'])) { + if (isset($infoByIP['countryCode'])) { + $peerCountry = render_flag($infoByIP['countryCode']); } } }