Skip to content

Commit

Permalink
manual grading: MDL-20581 Fix potential XSS problem.
Browse files Browse the repository at this point in the history
Thanks to Penny for spotting this.
Merged from MOODLE_19_STABLE.
  • Loading branch information
timhunt committed Nov 19, 2009
1 parent 2d0d78b commit 5ffd142
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mod/quiz/db/access.php
Expand Up @@ -65,7 +65,7 @@

// Manually grade and comment on student attempts at a question.
'mod/quiz:grade' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -77,7 +77,7 @@

// Regrade quizzes.
'mod/quiz:regrade' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/version.php
Expand Up @@ -5,7 +5,7 @@
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////

$module->version = 2009042000; // The (date) version of this module
$module->version = 2009111900; // The (date) version of this module
$module->requires = 2009041700; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?
Expand Down
5 changes: 4 additions & 1 deletion question/type/questiontype.php
Expand Up @@ -946,7 +946,10 @@ function print_question(&$question, &$state, $number, $cmoptions, $options) {
$grade .= question_format_grade($cmoptions, $question->maxgrade);
}

$comment = $state->manualcomment;
$formatoptions = new stdClass;
$formatoptions->para = false;
$comment = format_text($state->manualcomment, FORMAT_HTML,
$formatoptions, $cmoptions->course);
$commentlink = '';

if (!empty($options->questioncommentlink)) {
Expand Down

0 comments on commit 5ffd142

Please sign in to comment.