Merge branch 'MDL-54793-master' of git://github.com/cameron1729/moodle

This commit is contained in:
Dan Poltawski
2016-09-27 11:13:35 +01:00
+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)) {