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'] .= '
' . ACTIVE_COMMENT_SUBSCRIPTION . '
'; } else { @@ -418,7 +418,7 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace } $_smartyComments[] = $comment; - if ($comment['id'] && $parentid !== VIEWMODE_LINEAR ) { + if (isset($comment['id']) && $comment['id'] && $parentid !== VIEWMODE_LINEAR ) { serendipity_printComments($comments, $comment['id'], ($depth+1), ($trace . $i . '.'), $smarty_block, $smarty_file); } } diff --git a/templates/2k11/admin/comments.inc.tpl b/templates/2k11/admin/comments.inc.tpl index e7bf6b17..192ae1ba 100644 --- a/templates/2k11/admin/comments.inc.tpl +++ b/templates/2k11/admin/comments.inc.tpl @@ -135,11 +135,11 @@
{$CONST.EMAIL}:
{if empty($comment.email)}N/A{else}{$comment.email|escape|truncate:40:"…"}{if $comment.subscribed == 'true'} ({$CONST.ACTIVE_COMMENT_SUBSCRIPTION}){/if}{/if} {$comment.action_email}
IP:
-
{if empty($comment.ip)}N/A{else}{$comment.ip|escape}{/if} {$comment.action_ip}
+
{if empty($comment.ip)}N/A{else}{$comment.ip|escape}{/if} {if isset($comment.action_ip)}{$comment.action_ip}{/if}
URL:
-
{if empty($comment.url)}N/A{else}{$comment.url|escape|truncate:40:"…"} {/if} {$comment.action_url}
+
{if empty($comment.url)}N/A{else}{$comment.url|escape|truncate:40:"…"} {/if} {if isset($comment.action_url)}{$comment.action_url}{/if}
{$CONST.REFERER}:
-
{if empty($comment.referer)}N/A{else}{$comment.referer|escape|truncate:40:"…"}{/if} {$comment.action_referer}
+
{if empty($comment.referer)}N/A{else}{$comment.referer|escape|truncate:40:"…"}{/if} {if isset($comment.action_referer)}{$comment.action_referer}{/if}
@@ -163,7 +163,9 @@
  • {/if} + {if isset($comment.action_more)} {$comment.action_more} + {/if} {/foreach} diff --git a/templates/2k11/comments.tpl b/templates/2k11/comments.tpl index 25f8a373..6d7c1d25 100644 --- a/templates/2k11/comments.tpl +++ b/templates/2k11/comments.tpl @@ -1,5 +1,5 @@ {foreach from=$comments item=comment name="comments"} -
    8}commentlevel-9{else}commentlevel-{$comment.depth}{/if}"> +
    8}commentlevel-9{else}commentlevel-{$comment.depth}{/if}">
    {if $comment.url}{/if}{$comment.author|default:$CONST.ANONYMOUS}{if $comment.url}{/if}{if 'spice_twitter_name'|array_key_exists:$comment and $comment.spice_twitter_name and not $comment.spice_twitter_followme} (@{$comment.spice_twitter_name}){/if} {$CONST.ON} : {if 'spice_twitter_name'|array_key_exists:$comment and $comment.spice_twitter_name && $comment.spice_twitter_followme} @@ -21,7 +21,7 @@