MDL-54793 webservice_xmlrpc: Don't treat GET and POST as arguments

This commit is contained in:
Cameron Ball
2016-09-01 15:15:10 +08:00
parent 35d5053ba2
commit b8d0f90ec7
+4 -10
View File
@@ -58,18 +58,11 @@ class webservice_xmlrpc_server extends webservice_base_server {
// Retrieve and clean the POST/GET parameters from the parameters specific to the server.
parent::set_web_service_call_settings();
// Get GET and POST parameters.
$methodvariables = array_merge($_GET, $_POST);
if ($this->authmethod == WEBSERVICE_AUTHMETHOD_USERNAME) {
$this->username = isset($methodvariables['wsusername']) ? $methodvariables['wsusername'] : null;
unset($methodvariables['wsusername']);
$this->password = isset($methodvariables['wspassword']) ? $methodvariables['wspassword'] : null;
unset($methodvariables['wspassword']);
$this->username = isset($_GET['wsusername']) ? $_GET['wsusername'] : null;
$this->password = isset($_GET['wspassword']) ? $_GET['wspassword'] : null;
} else {
$this->token = isset($methodvariables['wstoken']) ? $methodvariables['wstoken'] : null;
unset($methodvariables['wstoken']);
$this->token = isset($_GET['wstoken']) ? $_GET['wstoken'] : null;
}
// Get the XML-RPC request data.
@@ -80,6 +73,7 @@ class webservice_xmlrpc_server extends webservice_base_server {
$decodedparams = xmlrpc_decode_request($rawpostdata, $methodname, 'UTF-8');
$methodinfo = external_api::external_function_info($methodname);
$methodparams = array_keys($methodinfo->parameters_desc->keys);
$methodvariables = [];
// Add the decoded parameters to the methodvariables array.
if (is_array($decodedparams)) {