Fix regression with HTTP_RAW_POST_DATA

This commit is contained in:
Kijin Sung 2015-12-08 15:50:52 +09:00
parent da0b1bad47
commit d117147d76

View file

@ -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)