Skip to content

Commit

Permalink
MDL-57775 xmlrpc: Pass escaping to xmlrpc_encode_request() calls
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudrd8mz committed Aug 15, 2017
1 parent f3625f4 commit 2b60428
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mnet/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion webservice/xmlrpc/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ public function call($functionname, $params = array()) {

// Set output options.
$outputoptions = array(
'encoding' => 'utf-8'
'encoding' => 'utf-8',
'escaping' => 'markup',
);

// Encode the request.
Expand Down

0 comments on commit 2b60428

Please sign in to comment.