Skip to content

Commit

Permalink
Raw Input. #51,#57
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jul 13, 2015
1 parent 6d758c4 commit a4af70a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Wechat/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a4af70a

Please sign in to comment.