From b2707b81aee60a66cf4a44fd9855e1fb9612cc0e Mon Sep 17 00:00:00 2001 From: onli Date: Sun, 2 May 2021 11:26:00 +0200 Subject: [PATCH] spamblock 1.89.3: php8 compat --- plugins/serendipity_event_spamblock/ChangeLog | 2 ++ .../serendipity_event_spamblock.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/serendipity_event_spamblock/ChangeLog b/plugins/serendipity_event_spamblock/ChangeLog index 6035827a..38f95396 100644 --- a/plugins/serendipity_event_spamblock/ChangeLog +++ b/plugins/serendipity_event_spamblock/ChangeLog @@ -1,3 +1,5 @@ +1.89.3: PHP 8 compatibility + 1.89.2: Dont refresh timeout when displaying comment preview 1.89.1: Modified sql statement used for htaccess blocking to work in MySQL 5.7. diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index facf0a11..b6ed4678 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -25,7 +25,7 @@ class serendipity_event_spamblock extends serendipity_event 'smarty' => '2.6.7', 'php' => '4.1.0' )); - $propbag->add('version', '1.89.2'); + $propbag->add('version', '1.89.3'); $propbag->add('event_hooks', array( 'frontend_saveComment' => true, 'external_plugin' => true, @@ -1446,15 +1446,25 @@ class serendipity_event_spamblock extends serendipity_event $eventData['action_more'] .= ' ' . PLUGIN_EVENT_SPAMBLOCK_NOT_SPAM . ''; } + + if (! isset($eventData['action_author'])) { + $eventData['action_author'] = ''; + } $eventData['action_author'] .= ' ' . ($author_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_AUTHOR : PLUGIN_EVENT_SPAMBLOCK_ADD_AUTHOR) . ''; if (!empty($eventData['url'])) { $url_is_filtered = $this->checkFilter('urls', $eventData['url']); + if (! isset($eventData['action_url'])) { + $eventData['action_url'] = ''; + } $eventData['action_url'] .= ' ' . ($url_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_URL : PLUGIN_EVENT_SPAMBLOCK_ADD_URL) . ''; } if (!empty($eventData['email'])) { $email_is_filtered = $this->checkFilter('emails', $eventData['email']); + if (! isset($eventData['action_email'])) { + $eventData['action_email'] = ''; + } $eventData['action_email'] .= ' ' . ($email_is_filtered ? PLUGIN_EVENT_SPAMBLOCK_REMOVE_EMAIL : PLUGIN_EVENT_SPAMBLOCK_ADD_EMAIL) . ''; } break;