diff --git a/mod/forum/post.php b/mod/forum/post.php index a9d5324356f..f4bdd2d1ef1 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -505,7 +505,7 @@ $replycount = forum_count_replies($post); - if (!empty($confirm)) { // User has confirmed the delete + if (!empty($confirm) && confirm_sesskey()) { // User has confirmed the delete if ($post->totalscore) { notice(get_string("couldnotdeleteratings", "forum"), @@ -561,7 +561,7 @@ } print_header(); notice_yesno(get_string("deletesureplural", "forum", $replycount+1), - "post.php?delete=$delete&confirm=$delete", + "post.php?delete=$delete&confirm=$delete&sesskey=".sesskey(), $CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#'.$post->id); forum_print_post($post, $course->id, $ownpost=false, $reply=false, $link=false); @@ -576,7 +576,7 @@ } else { print_header(); notice_yesno(get_string("deletesure", "forum", $replycount), - "post.php?delete=$delete&confirm=$delete", + "post.php?delete=$delete&confirm=$delete&sesskey=".sesskey(), $CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#'.$post->id); forum_print_post($post, $forum->course, $ownpost=false, $reply=false, $link=false); } @@ -818,4 +818,4 @@ print_footer($course); -?> \ No newline at end of file +?>