From 07f93cb76b64d4dbc7662d7695a75f5fe0847e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=81=E5=AE=81?= Date: Mon, 1 Sep 2014 23:52:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=96=B0=E5=B8=B8=E9=87=8F?= =?UTF-8?q?=20=5F=5FTYPECHO=5FIP=5FSOURCE=5F=5F=20=E7=94=A8=E6=9D=A5?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E4=BB=8E=E5=93=AA=E4=B8=AA=E9=A1=B9=E9=87=8C?= =?UTF-8?q?=E8=AF=BB=E5=8F=96IP=E5=9C=B0=E5=9D=80=EF=BC=8C=E6=AF=94?= =?UTF-8?q?=E5=A6=82HTTP=5FX=5FREAL=5FIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- var/Typecho/Request.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/Typecho/Request.php b/var/Typecho/Request.php index cb55dccb..09861f24 100644 --- a/var/Typecho/Request.php +++ b/var/Typecho/Request.php @@ -621,8 +621,8 @@ class Typecho_Request $this->_ip = $ip; } else { switch (true) { - case NULL !== $this->getServer('HTTP_X_FORWARDED_FOR'): - list($this->_ip) = array_map('trim', explode(',', $this->getServer('HTTP_X_FORWARDED_FOR'))); + 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');