mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-07-15 16:58:08 +00:00
Update index.php
This commit is contained in:
parent
0138d6563c
commit
2eb1c061c9
|
@ -367,7 +367,16 @@ function get_client_address() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse a context
|
// parse a context
|
||||||
$context = json_decode(file_get_contents('php://input'), true);
|
$context = array();
|
||||||
|
$rawdata = file_get_contents('php://input');
|
||||||
|
$pos = strpos("<?xml", $rawdata);
|
||||||
|
if ($pos !== false) {
|
||||||
|
// JSON-RPC 2
|
||||||
|
$context = json_decode($rawdata, true);
|
||||||
|
} else {
|
||||||
|
// XML-RPC
|
||||||
|
$context = xmlrpc_decode_request($rawdata, $method);
|
||||||
|
}
|
||||||
|
|
||||||
// check is it jsonrpc (stateless)
|
// check is it jsonrpc (stateless)
|
||||||
if ($context['jsonrpc'] == "2.0") {
|
if ($context['jsonrpc'] == "2.0") {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user