Skip to content

Commit

Permalink
StudentQuiz: can we mitigate the potential XSS risks? #812360
Browse files Browse the repository at this point in the history
  • Loading branch information
Khoa Nguyen committed Aug 20, 2024
1 parent ecd900c commit f4729db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ function studentquiz_supports($feature) {
}
}

/**
* Callback immediately after require_login succeeds.
*/
function studentquiz_after_require_login() {
global $PAGE, $CFG;

if ($PAGE->activityname === 'studentquiz') {
$CFG->forceclean = true;
}
}

/**
* Saves a new instance of the StudentQuiz into the database
*
Expand Down

0 comments on commit f4729db

Please sign in to comment.