From 80ab9dffcd4269d56582fe2e8b80e758c994af9d Mon Sep 17 00:00:00 2001 From: bnu Date: Mon, 18 May 2015 17:39:25 +0900 Subject: [PATCH] =?UTF-8?q?PHP=20=ED=98=B8=ED=99=98=EC=84=B1=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0=20-=20$HTTP=5FRAW=5FPOST=5FDATA=20-=20$=5FSERVER['HTT?= =?UTF-8?q?P=5FCONTENT=5FTYPE']?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/context/Context.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 612e29e3fa..3b9cae51ce 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -200,6 +200,10 @@ function Context() */ function init() { + if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === true) { + $GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents('php://input'); + } + // set context variables in $GLOBALS (to use in display handler) $this->context = &$GLOBALS['__Context__']; $this->context->lang = &$GLOBALS['lang']; @@ -1145,7 +1149,7 @@ function setRequestMethod($type = '') ($type && $self->request_method = $type) or ((strpos($_SERVER['CONTENT_TYPE'], 'json') || strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json')) && $self->request_method = 'JSON') or - (file_get_contents('php://input') && $self->request_method = 'XMLRPC') or + ($GLOBALS['HTTP_RAW_POST_DATA'] && $self->request_method = 'XMLRPC') or ($self->js_callback_func && $self->request_method = 'JS_CALLBACK') or ($self->request_method = $_SERVER['REQUEST_METHOD']); } @@ -1249,7 +1253,7 @@ function _setJSONRequestArgument() } $params = array(); - parse_str(file_get_contents('php://input'), $params); + parse_str($GLOBALS['HTTP_RAW_POST_DATA'], $params); foreach($params as $key => $val) { @@ -1269,7 +1273,7 @@ function _setXmlRpcArgument() return; } - $xml = file_get_contents('php://input'); + $xml = $GLOBALS['HTTP_RAW_POST_DATA']; if(Security::detectingXEE($xml)) { header("HTTP/1.0 400 Bad Request");