diff --git a/mod/data/lib.php b/mod/data/lib.php
index 7d449bd9cbc..daa023bd0db 100755
--- a/mod/data/lib.php
+++ b/mod/data/lib.php
@@ -1827,7 +1827,7 @@ function data_presets_export($course, $cm, $data) {
$presetxml .= "\n";
foreach ($settingssaved as $setting) {
- $presetxml .= "<$setting>{$data->$setting}$setting>\n";
+ $presetxml .= "<$setting>".htmlentities($data->$setting)."$setting>\n";
}
$presetxml .= "\n\n";
@@ -1837,7 +1837,7 @@ function data_presets_export($course, $cm, $data) {
$presetxml .= "\n";
foreach ($field as $key => $value) {
if ($value != '' && $key != 'id' && $key != 'dataid') {
- $presetxml .= "<$key>$value$key>\n";
+ $presetxml .= "<$key>".htmlentities($value)."$key>\n";
}
}
$presetxml .= "\n\n";