summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-02-26 18:04:52 +0100
committerAndrey Andreev <narf@devilix.net>2015-02-26 18:04:52 +0100
commit23824b85d2e51f1f7930631bd84143ff9c078b50 (patch)
tree0b3c9b86ed80589fe01b6f9eb57e1ffa45eef374 /system
parentdb20caad0c7a25152264033fbded3827ed5f72b1 (diff)
parent1e35792cc2d231cba11c2faefd71717ab67a46d2 (diff)
Merge pull request #3604 from Ignasimg/patch-1
Add support for raw_input_stream
Diffstat (limited to 'system')
-rw-r--r--system/core/Input.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index fae3b6c08..c3382b4d9 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -103,6 +103,8 @@ class CI_Input {
*/
protected $headers = array();
+ protected $_raw_input_stream;
+
/**
* Input stream data
*
@@ -313,7 +315,8 @@ class CI_Input {
// so we'll need to check if we have already done that first.
if ( ! is_array($this->_input_stream))
{
- parse_str(file_get_contents('php://input'), $this->_input_stream);
+ // $this->raw_input_stream will trigger __get().
+ parse_str($this->raw_input_stream, $this->_input_stream);
is_array($this->_input_stream) OR $this->_input_stream = array();
}
@@ -322,6 +325,17 @@ 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
*