From bddfa51dcf39b8486379adcb63e18c8bc92e4633 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 20 Nov 2009 08:50:52 +0000 Subject: [PATCH] MDL-20901 fixed input validation --- mod/glossary/comment.php | 4 ++-- mod/glossary/import.html | 1 + mod/glossary/import.php | 1 + mod/glossary/rate.php | 2 +- mod/glossary/view.php | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index c9c7e0592e0..792b42a8512 100644 --- a/mod/glossary/comment.php +++ b/mod/glossary/comment.php @@ -118,14 +118,14 @@ function glossary_comment_delete() { error('You can\'t delete comments in this glossary!'); } - if (data_submitted() and $confirm) { + if (data_submitted() and $confirm and confirm_sesskey()) { delete_records('glossary_comments','id', $cid); add_to_log($course->id, 'glossary', 'delete comment', "comments.php?id=$cm->id&eid=$entry->id", "$comment->id",$cm->id); redirect("comments.php?id=$cm->id&eid=$entry->id"); } else { $linkyes = 'comment.php'; - $optionsyes = array('action'=>'delete', 'cid'=>$cid, 'confirm'=>1); + $optionsyes = array('action'=>'delete', 'cid'=>$cid, 'confirm'=>1, 'sesskey'=>sesskey()); $linkno = 'comments.php'; $optionsno = array('id'=>$cm->id, 'eid'=>$entry->id); $strdeletewarning = get_string('areyousuredeletecomment','glossary'); diff --git a/mod/glossary/import.html b/mod/glossary/import.html index 0f450498c44..326b87cc0f9 100644 --- a/mod/glossary/import.html +++ b/mod/glossary/import.html @@ -44,6 +44,7 @@
+
diff --git a/mod/glossary/import.php b/mod/glossary/import.php index 56edc02a42a..a4bc1ce17b4 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -61,6 +61,7 @@ exit; } + require_sesskey(); $form = data_submitted(); $file = $_FILES["file"]; diff --git a/mod/glossary/rate.php b/mod/glossary/rate.php index e31cef45840..7d805b2233f 100644 --- a/mod/glossary/rate.php +++ b/mod/glossary/rate.php @@ -44,7 +44,7 @@ $returnurl = $CFG->wwwroot.'/mod/glossary/view.php?id='.$cm->id; } - if ($data = data_submitted()) { // form submitted + if ($data = data_submitted() and confirm_sesskey()) { // form submitted /// Calculate scale values $scale_values = make_grades_menu($glossary->scale); diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 2f150a79ea2..c216488eb4c 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -415,6 +415,7 @@ echo "
"; echo "
"; echo "id\" />"; + echo ""; } foreach ($allentries as $entry) {