Add form token to comment delete link

This commit is contained in:
onli 2017-01-17 11:42:37 +01:00
parent f947c66f66
commit 7e70f91686

View File

@ -357,6 +357,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace
$_smartyComments = array();
}
$formToken = serendipity_setFormToken('url');
$i = 0;
foreach ($comments as $comment) {
if ($parentid === VIEWMODE_LINEAR || !isset($comment['parent_id']) || $comment['parent_id'] == $parentid) {
@ -364,7 +365,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace
$comment['comment'] = serendipity_specialchars(strip_tags($comment['body']));
$comment['url'] = strip_tags($comment['url']);
$comment['link_delete'] = $serendipity['baseURL'] . 'comment.php?serendipity[delete]=' . $comment['id'] . '&serendipity[entry]=' . $comment['entry_id'] . '&serendipity[type]=comments';
$comment['link_delete'] = $serendipity['baseURL'] . 'comment.php?serendipity[delete]=' . $comment['id'] . '&serendipity[entry]=' . $comment['entry_id'] . '&serendipity[type]=comments&' . $formToken;
/* Fix invalid cases in protocoll part */
if (!empty($comment['url'])) {