From df09d649abf70a92cb64eee470dbbc9684e8ad01 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 20 Nov 2009 08:51:20 +0000 Subject: [PATCH] MDL-20901 fixed input validation --- mod/glossary/comment.php | 4 ++-- mod/glossary/import.html | 1 + mod/glossary/import.php | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/glossary/comment.php b/mod/glossary/comment.php index 9e8626208b6..1857befbb8e 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 0a83eef4d2a..e555b8b0658 100644 --- a/mod/glossary/import.php +++ b/mod/glossary/import.php @@ -63,6 +63,7 @@ exit; } + require_sesskey(); $form = data_submitted(); $file = $_FILES["file"];