MDL-62820 question import: properly escape output

This commit is contained in:
Tim Hunt
2018-07-04 15:40:58 +08:00
committed by Jun Pataleta
parent caa9881c0d
commit 8ac7c623d3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -726,8 +726,8 @@ class qformat_default {
// @@PLUGINFILE@@ with a real URL, but it doesn't matter what.
// We use http://example.com/.
$text = str_replace('@@PLUGINFILE@@/', 'http://example.com/', $question->questiontext);
return html_to_text(format_text($text,
$question->questiontextformat, $formatoptions), 0, false);
return s(html_to_text(format_text($text,
$question->questiontextformat, $formatoptions), 0, false));
}
/**
+2 -2
View File
@@ -979,8 +979,8 @@ class qformat_default {
* during import to let the user see roughly what is going on.
*/
protected function format_question_text($question) {
return question_utils::to_plain_text($question->questiontext,
$question->questiontextformat);
return s(question_utils::to_plain_text($question->questiontext,
$question->questiontextformat));
}
}