Skip to content

Commit

Permalink
don't use ['HTTP_RAW_POST_DATA'] in check
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed May 29, 2015
1 parent c836759 commit fc76ddd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/json-rpc.php
Expand Up @@ -112,12 +112,12 @@ function handle_json_rpc($object) {
if ($encoding != 'UTF-8') {
$input = iconv($encoding, 'UTF-8', $input);
}
$input = json_decode($input);
$json = json_decode($input);
header('Content-Type: text/plain');

// handle Errors
if (!$input) {
if ($GLOBALS['HTTP_RAW_POST_DATA'] == "") {
if (!$json) {
if ($input == "") {
echo response(null, 0, array("code"=> -32700,
"message"=>"Parse Error: no data"));
} else {
Expand Down

0 comments on commit fc76ddd

Please sign in to comment.