Update index.php

This commit is contained in:
Namhyeon Go 2024-02-29 17:27:53 +09:00 committed by GitHub
parent 0138d6563c
commit 2eb1c061c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -367,7 +367,16 @@ function get_client_address() {
}
// 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)
if ($context['jsonrpc'] == "2.0") {