Update index.php

This commit is contained in:
Namhyeon Go 2024-02-29 17:38:03 +09:00 committed by GitHub
parent fd369d9464
commit f9df624357
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -376,7 +376,7 @@ if ($pos !== false) {
$context = xmlrpc_decode_request($rawdata, $method); // XML-RPC
}
// check is it jsonrpc (stateless)
// check is it JSON-RPC 2 (stateless)
if ($context['jsonrpc'] == "2.0") {
$method = $context['method'];
switch ($method) {
@ -447,3 +447,22 @@ if ($context['jsonrpc'] == "2.0") {
break;
}
}
// check is it XML-RPC (stateless)
// Use the target server as a simple CMS
if (array_key_exists("methodCall", $context)) {
$method = $context['methodName'];
switch ($method) {
case "metaWeblog.newPost":
// todo
break;
case "metaWeblog.getRecentPosts":
// todo
break;
case "metaWeblog.newMediaObject":
// todo
break;
}
}