diff --git a/include/admin/comments.inc.php b/include/admin/comments.inc.php index c14c8e1e..7ca7a539 100644 --- a/include/admin/comments.inc.php +++ b/include/admin/comments.inc.php @@ -13,7 +13,7 @@ $errormsg = array(); $msg = array(); if (isset($serendipity['POST']['formAction']) && $serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['POST']['delete']) != 0 && serendipity_checkFormToken()) { - if ($serendipity['POST']['togglemoderate'] != '') { + if (($serendipity['POST']['togglemoderate'] ?? null) != '') { foreach ( $serendipity['POST']['delete'] as $k => $v ) { $ac = serendipity_approveComment((int)$k, (int)$v, false, 'flip'); if ($ac > 0) { @@ -54,7 +54,7 @@ if (isset($serendipity['GET']['adminAction']) && $serendipity['GET']['adminActio $comment['comment'] = trim($serendipity['POST']['comment']); $comment['name'] = $serendipity['POST']['name']; $comment['email'] = $serendipity['POST']['email']; - $comment['subscribe'] = $serendipity['POST']['subscribe']; + $comment['subscribe'] = $serendipity['POST']['subscribe'] ?? false; $comment['parent_id'] = $serendipity['POST']['replyTo']; if (!empty($comment['comment'])) { @@ -131,7 +131,8 @@ if (isset($serendipity['GET']['adminAction']) && ($serendipity['GET']['adminActi 'body' => $serendipity['POST']['comment'], 'url' => $serendipity['POST']['url'], 'timestamp' => time(), - 'parent_id' => $serendipity['GET']['id'] + 'parent_id' => $serendipity['GET']['id'], + 'id' => null ); } diff --git a/include/functions_comments.inc.php b/include/functions_comments.inc.php index 967785fd..7c00b4c2 100644 --- a/include/functions_comments.inc.php +++ b/include/functions_comments.inc.php @@ -367,7 +367,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace $comment['comment'] = (is_string($comment['body']) ? serendipity_specialchars(strip_tags($comment['body'])) : ''); $comment['url'] = (is_string($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&' . $formToken; + $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'])) { @@ -406,7 +406,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace } if (serendipity_userLoggedIn()) { - if ($comment['subscribed'] == 'true') { + if (($comment['subscribed'] ?? null) == 'true') { if ($comment['status'] == 'approved') { $comment['body'] .= '