mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 18:21:53 +02:00
防止伪造ip
This commit is contained in:
parent
bc12f48ac7
commit
7de46fd2b4
@ -649,12 +649,12 @@ class Typecho_Request
|
||||
case defined('__TYPECHO_IP_SOURCE__') && NULL !== $this->getServer(__TYPECHO_IP_SOURCE__):
|
||||
list($this->_ip) = array_map('trim', explode(',', $this->getServer(__TYPECHO_IP_SOURCE__)));
|
||||
break;
|
||||
case NULL !== $this->getServer('HTTP_CLIENT_IP'):
|
||||
$this->_ip = $this->getServer('HTTP_CLIENT_IP');
|
||||
break;
|
||||
case NULL !== $this->getServer('REMOTE_ADDR'):
|
||||
$this->_ip = $this->getServer('REMOTE_ADDR');
|
||||
break;
|
||||
case NULL !== $this->getServer('HTTP_CLIENT_IP'):
|
||||
$this->_ip = $this->getServer('HTTP_CLIENT_IP');
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user