From baa54b0a8fb8762dc8bbd85e6a865f63a349e4d9 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Sun, 31 Jul 2005 17:58:54 +0000 Subject: [PATCH] Spamblock plugin: Discard empty values --- .../serendipity_event_spamblock.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index 9571369..af75dbc 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -191,7 +191,7 @@ var $filter_defaults; 'smarty' => '2.6.7', 'php' => '4.1.0' )); - $propbag->add('version', '1.21'); + $propbag->add('version', '1.22'); $propbag->add('event_hooks', array( 'frontend_saveComment' => true, 'external_plugin' => true, @@ -484,6 +484,9 @@ var $filter_defaults; $filter_authors = explode(';', $this->get_config('contentfilter_authors', $this->filter_defaults['authors'])); if (is_array($filter_authors)) { foreach($filter_authors AS $filter_author) { + if (empty($filter_author)) { + continue; + } if (preg_match('@' . $filter_author . '@', $addData['name'])) { if ($filter_type == 'moderate') { $this->log($logfile, $eventData['id'], 'MODERATE', PLUGIN_EVENT_SPAMBLOCK_FILTER_AUTHORS, $addData); @@ -505,6 +508,9 @@ var $filter_defaults; $filter_urls = explode(';', $this->get_config('contentfilter_urls', $this->filter_defaults['urls'])); if (is_array($filter_urls)) { foreach($filter_urls AS $filter_url) { + if (empty($filter_url)) { + continue; + } if (preg_match('@' . $filter_url . '@', $addData['url'])) { if ($filter_type == 'moderate') { $this->log($logfile, $eventData['id'], 'MODERATE', PLUGIN_EVENT_SPAMBLOCK_FILTER_URLS, $addData); -- 2.39.5