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

index 8d8c29e6aa769f929eeee6b3081b63d0d95cb015..a43be2a99b485c1af0459b9e256dc4ba249e9ae1 100644 (file)
@@ -172,7 +172,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,
@@ -445,6 +445,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);
@@ -466,6 +469,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);