]> git.mjollnir.org Git - s9y.git/commitdiff
Spamblock plugin: Discard empty values
authorgarvinhicking <garvinhicking>
Sun, 31 Jul 2005 17:58:54 +0000 (17:58 +0000)
committergarvinhicking <garvinhicking>
Sun, 31 Jul 2005 17:58:54 +0000 (17:58 +0000)
plugins/serendipity_event_spamblock/serendipity_event_spamblock.php

index 957136909dc9b21df704d10bb613320de7c1362f..af75dbceefafe40b548bc1188396846487f80deb 100644 (file)
@@ -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);