From 73c133c91dbd4ed8dba4496ce764fee90906fa62 Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Tue, 2 Jun 2020 12:14:16 +0200 Subject: [PATCH] [ticket/16508] Fix WhoIs lookup PHPBB3-16508 --- phpBB/includes/functions_user.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d39dbed5ff..a44b92dd8d 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1470,8 +1470,11 @@ function user_ipwhois($ip) $ipwhois = ''; - // Limit the query to all possible flags (whois.arin.net) - $ip = 'z ' . $ip; + if (!filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) + { + // Limit the query to all possible flags (whois.arin.net) + $ip = 'z ' . $ip; + } if (($fsk = @fsockopen($whois_host, 43))) {