Skip to content
Browse files

on multichoice questions with multianswer, the code was not cleaning …

…the variables correctly. Now sends the array through a foreach and then clean_param on each element in the array. Fix is around line 855.
  • Loading branch information...
1 parent 93943f6 commit c32bc595bd347454b59181b86d324d81ac79a192 michaelpenne committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 mod/lesson/lesson.php
View
5 mod/lesson/lesson.php
@@ -853,7 +853,10 @@
if ($page->qoption) {
// MULTIANSWER allowed, user's answer is an array
if (isset($_POST['answer'])) {
- $useranswers = optional_param('answer');
+ $useranswers = $_POST['answer'];
+ foreach ($useranswers as $key => $useranswer) {
+ $useranswers[$key] = clean_param($useranswer, PARAM_INT);
+ }
} else {
$noanswer = true;
break;

0 comments on commit c32bc59

Please sign in to comment.
Something went wrong with that request. Please try again.