1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 01:10:51 +01:00

Fix for IPv6-IPv4 setups with IPv4 addresses as "::x.x.x.x" and not :ffff

This commit is contained in:
Savetheinternet 2011-02-28 16:04:06 +11:00
parent c27027d3e0
commit cfbda5433a

View File

@ -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];
}
}