diff --git a/src/Wechat/Server.php b/src/Wechat/Server.php index ab5a6b563..6cdd1d5bb 100644 --- a/src/Wechat/Server.php +++ b/src/Wechat/Server.php @@ -189,7 +189,15 @@ protected function prepareInput() return; } - $xmlInput = file_get_contents('php://input'); + if (version_compare(PHP_VERSION, '5.6'), '<') { + if (!empty($GLOBALS['HTTP_RAW_POST_DATA'])) { + $xmlInput = $GLOBALS['HTTP_RAW_POST_DATA']; + } else { + $xmlInput = file_get_contents('php://input'); + } + } else { + $xmlInput = file_get_contents('php://input'); + } $input = XML::parse($xmlInput);