MDL-13088 - database presets weren't escaping bad chars, causing presets

to break with a rogue <
merged from MOODLE_19_STABLE
This commit is contained in:
poltawski 2008-01-24 19:41:17 +00:00
parent a03320fcf9
commit 70c003a241

View File

@ -1827,7 +1827,7 @@ function data_presets_export($course, $cm, $data) {
$presetxml .= "<settings>\n";
foreach ($settingssaved as $setting) {
$presetxml .= "<$setting>{$data->$setting}</$setting>\n";
$presetxml .= "<$setting>".htmlentities($data->$setting)."</$setting>\n";
}
$presetxml .= "</settings>\n\n";
@ -1837,7 +1837,7 @@ function data_presets_export($course, $cm, $data) {
$presetxml .= "<field>\n";
foreach ($field as $key => $value) {
if ($value != '' && $key != 'id' && $key != 'dataid') {
$presetxml .= "<$key>$value</$key>\n";
$presetxml .= "<$key>".htmlentities($value)."</$key>\n";
}
}
$presetxml .= "</field>\n\n";