summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Bellone <jb@thunkbrightly.com>2011-08-21 17:41:32 +0200
committerJohn Bellone <jb@thunkbrightly.com>2011-08-21 17:41:32 +0200
commit52c10b68c275248eb7e12ec1d039876cd5f81f11 (patch)
tree1c7304d5cb8f55e89b132f61fcb854a7f77c6088
parent43194ea1af658914a89ca49aed4dca4617b9c4ff (diff)
Making changes to stop remote spoofing
-rw-r--r--system/core/Input.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index cfbef942d..365f779de 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -287,13 +287,13 @@ class CI_Input {
$this->ip_address = in_array($_SERVER['REMOTE_ADDR'], $proxies) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
}
- elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
+ elseif ($this->server('REMOTE_ADDR') AND ! $this->server('HTTP_CLIENT_IP'))
{
- $this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
+ $this->ip_address = $_SERVER['REMOTE_ADDR'];
}
- elseif ($this->server('REMOTE_ADDR'))
+ elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP'))
{
- $this->ip_address = $_SERVER['REMOTE_ADDR'];
+ $this->ip_address = $_SERVER['HTTP_CLIENT_IP'];
}
elseif ($this->server('HTTP_CLIENT_IP'))
{