From d117147d7623f63a8713d9876d52f3a6ce8f06c3 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Tue, 8 Dec 2015 15:50:52 +0900 Subject: [PATCH] Fix regression with HTTP_RAW_POST_DATA --- classes/context/Context.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 7f04726cb..01e46b7db 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -200,8 +200,13 @@ 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) { $GLOBALS['HTTP_RAW_POST_DATA'] = file_get_contents("php://input"); + if(!preg_match('/^[<\{\[]/', $GLOBALS['HTTP_RAW_POST_DATA'])) + { + unset($GLOBALS['HTTP_RAW_POST_DATA']); + } } // set context variables in $GLOBALS (to use in display handler)