-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
I am having problems with the getVisitIp() function, which does not support IPv6, because it uses preg_match with an IPv4 expression.
I modified the getVisitIp() to:
function getVisitIp() {
$ipKeys = array(
'HTTP_X_FORWARDED_FOR',
'HTTP_CLIENT_IP',
'HTTP_CF_CONNECTING_IP',
);
foreach($ipKeys as $ipKey) {
if (isset($_SERVER[$ipKey]) && $_SERVER[$ipKey]!="")
return $_SERVER[$ipKey];
}
return arrayValue($_SERVER, 'REMOTE_ADDR');
}
miyurusankalpa
Metadata
Metadata
Assignees
Labels
No labels