diff options
author | Andrey Andreev <narf@devilix.net> | 2015-02-27 10:41:52 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2015-02-27 10:41:52 +0100 |
commit | d0ac8b132390387d08bcaa5a20fbea35a350c9d3 (patch) | |
tree | 6f286471c894d139045f6055aab3ca0dbf3fd155 /system/core | |
parent | 23824b85d2e51f1f7930631bd84143ff9c078b50 (diff) |
Fix an E_NOTICE caused by #3604
Diffstat (limited to 'system/core')
-rw-r--r-- | system/core/Input.php | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/system/core/Input.php b/system/core/Input.php index c3382b4d9..3e792fc13 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -103,17 +103,26 @@ class CI_Input { */ protected $headers = array(); + /** + * Raw input stream data + * + * Holds a cache of php://input contents + * + * @var string + */ protected $_raw_input_stream; /** - * Input stream data + * Parsed input stream data * * Parsed from php://input at runtime * * @see CI_Input::input_stream() * @var array */ - protected $_input_stream = NULL; + protected $_input_stream; + + // -------------------------------------------------------------------- /** * Class constructor @@ -325,17 +334,6 @@ class CI_Input { // ------------------------------------------------------------------------ - public function __get($name) - { - if ($name === 'raw_input_stream') - { - isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); - return $this->_raw_input_stream; - } - } - - // ------------------------------------------------------------------------ - /** * Set cookie * @@ -860,4 +858,23 @@ class CI_Input { : strtolower($this->server('REQUEST_METHOD')); } + // ------------------------------------------------------------------------ + + /** + * Magic __get() + * + * Allows read access to protected properties + * + * @param string $name + * @return mixed + */ + public function __get($name) + { + if ($name === 'raw_input_stream') + { + isset($this->_raw_input_stream) OR $this->_raw_input_stream = file_get_contents('php://input'); + return $this->_raw_input_stream; + } + } + } |