MDL-54010 roles: Fix missing HTMLspecialchars in role export code.

Role name and description fields are currently not escaped when
exporting a role. This results in an unusable file when characters
such as ampersands are used in a name or description. Fix this by
using htmlspecialchars on both fields.

Signed-off-by: Nigel Cunningham <[email protected]>
This commit is contained in:
Nigel Cunningham
2016-05-26 10:32:00 +08:00
committed by Cameron Ball
parent b1b097e2b6
commit 9efa43c6a9
+2 -2
View File
@@ -71,8 +71,8 @@ class core_role_preset {
$dom->appendChild($top);
$top->appendChild($dom->createElement('shortname', $role->shortname));
$top->appendChild($dom->createElement('name', $role->name));
$top->appendChild($dom->createElement('description', $role->description));
$top->appendChild($dom->createElement('name', htmlspecialchars($role->name)));
$top->appendChild($dom->createElement('description', htmlspecialchars($role->description)));
$top->appendChild($dom->createElement('archetype', $role->archetype));
$contextlevels = $dom->createElement('contextlevels');