MDL-57775 xmlrpc: Pass escaping to xmlrpc_encode_request() calls

This patch adds the missing 'escaping' option to all remaining
xmlrpc_encode_request() calls in the moodle core code.

Without this, the xmlrpc_decode_request() call on the server side may
lead to wrongly decoded non-ascii characters.
This commit is contained in:
David Mudrák
2017-08-15 13:42:08 +02:00
parent 65097503ac
commit e70a466017
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -56,7 +56,10 @@ function mnet_get_public_key($uri, $application=null) {
$application = $DB->get_record('mnet_application', array('name'=>'moodle'));
}
$rq = xmlrpc_encode_request('system/keyswap', array($CFG->wwwroot, $mnet->public_key, $application->name), array("encoding" => "utf-8"));
$rq = xmlrpc_encode_request('system/keyswap', array($CFG->wwwroot, $mnet->public_key, $application->name), array(
'encoding' => 'utf-8',
'escaping' => 'markup',
));
$ch = curl_init($uri . $application->xmlrpc_server_url);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
+2 -1
View File
@@ -75,7 +75,8 @@ class webservice_xmlrpc_client {
// Set output options.
$outputoptions = array(
'encoding' => 'utf-8'
'encoding' => 'utf-8',
'escaping' => 'markup',
);
// Encode the request.