diff options
author | Andrey Andreev <narf@devilix.net> | 2015-02-27 14:09:34 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-02-27 14:09:34 +0100 |
commit | 52caf59f244e0c1363ac0ce6ba61a7f5001603df (patch) | |
tree | 3e5da9669a232579dd1637d567414206601ccf9e | |
parent | 7d365dcc8bdf69534b54401cc862be105e1a8a28 (diff) |
Make CI_Input:: read-only as well
-rw-r--r-- | system/core/Input.php | 6 | ||||
-rw-r--r-- | tests/mocks/core/input.php | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index be9f3c169..6be4b9a6c 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -55,7 +55,7 @@ class CI_Input { * * @var string */ - public $ip_address = FALSE; + protected $ip_address = FALSE; /** * Allow GET array flag @@ -878,6 +878,10 @@ class CI_Input { isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); return $this->_raw_input_stream; } + elseif ($name === 'ip_address') + { + return $this->ip_address; + } } } diff --git a/tests/mocks/core/input.php b/tests/mocks/core/input.php index 0d1873849..40e27441f 100644 --- a/tests/mocks/core/input.php +++ b/tests/mocks/core/input.php @@ -38,4 +38,12 @@ class Mock_Core_Input extends CI_Input { return FALSE; } + public function __set($name, $value) + { + if ($name === 'ip_address') + { + $this->ip_address = $value; + } + } + }
\ No newline at end of file |