From 985151913c3a75d817db4746bc2dbf3a93e9b019 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 3 Aug 2010 11:07:40 +0200 Subject: [PATCH] [ticket/9746] Ease up phpbb_ip_normalise() function. PHPBB3-9746 --- phpBB/includes/functions.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ac3641ae17..3048825064 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3310,27 +3310,8 @@ function phpbb_ip_normalise($address) { return $address; } - else if (preg_match(get_preg_expression('ipv6'), $address)) - { - $address = phpbb_inet_ntop(phpbb_inet_pton($address)); - if (strpos($address, '::ffff:') === 0) - { - // IPv4-mapped address - $address_ipv4 = substr($address, 7); - - if (preg_match(get_preg_expression('ipv4'), $address_ipv4)) - { - return $address_ipv4; - } - - return false; - } - - return $address; - } - - return false; + return phpbb_inet_ntop(phpbb_inet_pton($address)); } /**