From cfbda5433af14d689b675447d56647588ef677dc Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Mon, 28 Feb 2011 16:04:06 +1100 Subject: [PATCH] Fix for IPv6-IPv4 setups with IPv4 addresses as "::x.x.x.x" and not :ffff --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index fabe5518..1b324a79 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -61,7 +61,7 @@ $__ip = $_SERVER['REMOTE_ADDR']; // ::ffff:0.0.0.0 - if(preg_match('/^\:\:ffff\:(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m)) + if(preg_match('/^\:\:(ffff\:)?(\d+\.\d+\.\d+\.\d+)$/', $__ip, $m)) $_SERVER['REMOTE_ADDR'] = $m[1]; } }