manual grading: MDL-20581 Fix potential XSS problem.

Thanks to Penny for spotting this.
This commit is contained in:
Tim Hunt
2009-11-19 17:30:11 +00:00
parent 85f530cf0d
commit 56ed03a328
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ $mod_quiz_capabilities = array(
// Manually grade and comment on student attempts at a question, and regrade quizzes.
'mod/quiz:grade' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
+4 -1
View File
@@ -874,7 +874,10 @@ class default_questiontype {
$grade .= $question->maxgrade;
}
$comment = stripslashes($state->manualcomment);
$formatoptions = new stdClass;
$formatoptions->para = false;
$comment = format_text(stripslashes($state->manualcomment), FORMAT_HTML,
$formatoptions, $cmoptions->course);
$commentlink = '';
if (!empty($options->questioncommentlink)) {