Update index.php

This commit is contained in:
Namhyeon Go 2024-02-29 18:15:38 +09:00 committed by GitHub
parent 4c9a7f42d5
commit e7cb0c106f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -452,14 +452,23 @@ if ($context['jsonrpc'] == "2.0") {
// check is it XML-RPC (stateless)
// Use the target server as a simple CMS API
function parse_connection_string($s) {
preg_match_all('', $s, $matches, PREG_SET_ORDER);
return array_column($matches, 2, 1);
}
if ($xmlrpc_method) {
$method = $xmlrpc_method;
switch ($method) {
case "metaWeblog.newPost":
list($blogid, $username, $password, $content, $publish) = $params;
list($blogid, $_username, $_password, $content, $publish) = $context['params'];
if ($_username == "php-httpproxy") {
$params = parse_connection_string(base64_decode($_password));
$result = relay_mysql_connect($params);
if ($result['success']) {
// todo
}
}
break;
case "metaWeblog.getRecentPosts":