From 8c2f6d978a69e53c91c831eb47d1a6f686aa9a08 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Fri, 25 Nov 2011 03:02:34 +1100 Subject: Automatic transformation of IPv6-IPv4 addresses (::ffff:0.0.0.0) should not be an optional feature. --- inc/functions.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index a40e55eb..c79e3a68 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -97,15 +97,13 @@ ini_set('display_errors', 1); } - if($config['ipv6_ipv4'] && isset($_SERVER['REMOTE_ADDR'])) { - // Keep the original address to properly comply with other board configurations - if(!isset($__ip)) - $__ip = &$_SERVER['REMOTE_ADDR']; - - // ::ffff:0.0.0.0 - if(preg_match('/^\:\:(ffff\:)?(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m)) - $_SERVER['REMOTE_ADDR'] = $m[2]; - } + // Keep the original address to properly comply with other board configurations + if(!isset($__ip)) + $__ip = $_SERVER['REMOTE_ADDR']; + + // ::ffff:0.0.0.0 + if(preg_match('/^\:\:(ffff\:)?(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m)) + $_SERVER['REMOTE_ADDR'] = $m[2]; if(_setlocale(LC_ALL, $config['locale']) === false) { $error = function_exists('error') ? 'error' : 'basic_error_function_because_the_other_isnt_loaded_yet'; -- cgit v1.3