public function getIp($allowProxied = false)
{
if ($allowProxied && $ip = $this->getServer('HTTP_CLIENT_IP'))
{
list($ip) = explode(',', $ip);
return $this->getFilteredIp($ip);
}
else if ($allowProxied && $ip = $this->getServer('HTTP_X_FORWARDED_FOR'))
{
list($ip) = explode(',', $ip);
return $this->getFilteredIp($ip);
}
if ($this->remoteIp === null)
{ public function getIp($allowProxied = false)
{
if ($allowProxied && $ip = $this->getServer('HTTP_CLIENT_IP'))
{
list($ip) = explode(',', $ip);
return $this->getFilteredIp($ip);
}
else if ($allowProxied && $ip = $this->getServer('HTTP_X_FORWARDED_FOR'))
{
list($ip) = explode(',', $ip);
return $this->getFilteredIp($ip);
}
if ($this->remoteIp === null)
{
$ip = $this->getTrustedRealIp($this->getServer('REMOTE_ADDR'));
$this->remoteIp = $this->getFilteredIp($ip);
}
return $this->remoteIp;
}
$ip = $this->getTrustedRealIp($this->getServer('REMOTE_ADDR'));
$this->remoteIp = $this->getFilteredIp($ip);
}
return $this->remoteIp;
}