MDL-17227 forum: add sesskey to post/discussion deletion. Backported from HEAD
This commit is contained in:
+4
-4
@@ -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);
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user