MDL-20929 fixed input validation

This commit is contained in:
Petr Skoda
2009-11-22 11:09:11 +00:00
parent e657980dfd
commit afb6f77dd9
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -443,6 +443,7 @@ function choice_show_results($choice, $course, $cm, $allresponses, $forcepublish
echo '<form id="attemptsform" method="post" action="'.$FULLSCRIPT.'" onsubmit="var menu = document.getElementById(\'menuaction\'); return (menu.options[menu.selectedIndex].value == \'delete\' ? \''.addslashes_js(get_string('deleteattemptcheck','quiz')).'\' : true);">';
echo '<div>';
echo '<input type="hidden" name="id" value="'.$cm->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="mode" value="overview" />';
}
+1 -1
View File
@@ -45,7 +45,7 @@
add_to_log($course->id, "choice", "report", "report.php?id=$cm->id", "$choice->id",$cm->id);
if ($action == 'delete' && has_capability('mod/choice:deleteresponses',$context)) {
if (data_submitted() && $action == 'delete' && has_capability('mod/choice:deleteresponses',$context) && confirm_sesskey()) {
choice_delete_responses($attemptids, $choice->id); //delete responses.
redirect("report.php?id=$cm->id");
}