From dc4c22d64a5de39b677ae704e6e81177fdca91b0 Mon Sep 17 00:00:00 2001 From: conory Date: Fri, 18 Dec 2015 18:45:12 +0900 Subject: [PATCH] =?UTF-8?q?=EB=8B=A4=EC=8B=9C=20=EB=82=98=ED=83=80?= =?UTF-8?q?=EB=82=9C=20HTTP=5FRAW=5FPOST=5FDATA=20=20=EB=AC=B8=EC=A0=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/context/Context.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 01e46b7db..2ad94ef30 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -201,9 +201,12 @@ class Context function init() { // fix missing HTTP_RAW_POST_DATA in PHP 5.6 and above - if(!isset($GLOBALS['HTTP_RAW_POST_DATA']) && version_compare(PHP_VERSION, '5.6.0', '>=') === true) { + 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"); - if(!preg_match('/^[<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA'])) + + // If content is not XML JSON, unset + if(!preg_match('/^[\<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA']) && strpos($_SERVER['CONTENT_TYPE'], 'json') === FALSE && strpos($_SERVER['HTTP_CONTENT_TYPE'], 'json') === FALSE) { unset($GLOBALS['HTTP_RAW_POST_DATA']); }