From 06f2402acae4e6db2f9922c48a5418dc57801064 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Mon, 10 Apr 2006 13:45:19 +0000 Subject: [PATCH] * The spamblock plugin now continues to check any comment/trackback set to MODERATE if maybe other rules override the status to REJECTED. This should reduce the amount of moderation mails that definitely are spam. (Bug #1467707) (garvinhicking) --- docs/NEWS | 5 ++++ .../serendipity_event_spamblock.php | 29 +++++++++---------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index acdbd21..45de028 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,11 @@ Version 1.0 () ------------------------------------------------------------------------ + * The spamblock plugin now continues to check any comment/trackback + set to MODERATE if maybe other rules override the status to + REJECTED. This should reduce the amount of moderation mails that + definitely are spam. (Bug #1467707) (garvinhicking) + * Fix UTF-8 encoding of $i18n_filename_* variables for building permalinks (Bug #1461754, Thanks to Kim Sullivan) (garvinhicking) diff --git a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php index 019ed86..5c78d8e 100644 --- a/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php +++ b/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php @@ -34,7 +34,7 @@ var $filter_defaults; 'smarty' => '2.6.7', 'php' => '4.1.0' )); - $propbag->add('version', '1.33'); + $propbag->add('version', '1.40'); $propbag->add('event_hooks', array( 'frontend_saveComment' => true, 'external_plugin' => true, @@ -350,16 +350,16 @@ var $filter_defaults; global $serendipity; $checkgroups = explode('^', $this->get_config('hide_for_authors')); - + if (!isset($serendipity['authorid']) || !is_array($checkgroups)) { return false; } - + $mygroups =& serendipity_getGroups($serendipity['authorid'], true); if (!is_array($mygroups)) { return false; } - + foreach($checkgroups AS $key => $groupid) { if ($groupid == 'all') { return true; @@ -367,7 +367,7 @@ var $filter_defaults; return true; } } - + return false; } @@ -432,7 +432,7 @@ var $filter_defaults; } } } - + // Check whether to allow comments from registered authors if (serendipity_userLoggedIn() && $this->inGroup()) { return true; @@ -461,15 +461,15 @@ var $filter_defaults; $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_REASON_API, $addData); $eventData = array('allow_comments' => false); $serendipity['messagestack']['comments'][] = PLUGIN_EVENT_SPAMBLOCK_REASON_API; + return false; } elseif ($this->get_config('disable_api_comments') == 'moderate') { $this->log($logfile, $eventData['id'], 'MODERATE', PLUGIN_EVENT_SPAMBLOCK_REASON_API, $addData); $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_REASON_API; } - return false; } - + // Check Trackback URLs? if ($addData['type'] == 'TRACKBACK' && serendipity_db_bool($this->get_config('trackback_check_url'))) { require_once S9Y_PEAR_PATH . 'HTTP/Request.php'; @@ -513,7 +513,6 @@ var $filter_defaults; $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_ERROR_BODY; - return false; } else { $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_FILTER_AUTHORS, $addData); $eventData = array('allow_comments' => false); @@ -537,7 +536,6 @@ var $filter_defaults; $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_ERROR_BODY; - return false; } else { $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_FILTER_URLS, $addData); $eventData = array('allow_comments' => false); @@ -560,7 +558,6 @@ var $filter_defaults; $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_ERROR_BODY; - return false; } else { $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_FILTER_WORDS, $addData); $eventData = array('allow_comments' => false); @@ -589,7 +586,6 @@ var $filter_defaults; $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_ERROR_BODY; - return false; } else { $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_REASON_BLOGG_SPAMLIST . ': ' . $domain, $addData); $eventData = array('allow_comments' => false); @@ -633,7 +629,6 @@ var $filter_defaults; $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_REASON_FORCEMODERATION; - return false; } // Check for maximum number of links before forcing moderation @@ -642,7 +637,6 @@ var $filter_defaults; $eventData['moderate_comments'] = true; $serendipity['csuccess'] = 'moderate'; $serendipity['moderate_reason'] = PLUGIN_EVENT_SPAMBLOCK_REASON_LINKS_MODERATE; - return false; } // Check for identical comments. We allow to bypass trackbacks from our server to our own blog. @@ -675,8 +669,13 @@ var $filter_defaults; $this->log($logfile, $eventData['id'], 'REJECTED', PLUGIN_EVENT_SPAMBLOCK_REASON_CHECKMAIL, $addData); $eventData = array('allow_comments' => false); $serendipity['messagestack']['comments'][] = PLUGIN_EVENT_SPAMBLOCK_REASON_CHECKMAIL; + return false; } } + + if ($eventData['moderate_comments'] == true) { + return false; + } } return true; @@ -790,7 +789,7 @@ var $filter_defaults; $pos_x = $pos_x + $size + 2; } - + if ($_captchas === 'scramble') { $line_diff = mt_rand(5, 15); $pixel_col = imagecolorallocate($image, trim($bgcolors[0])-mt_rand(10,50), trim($bgcolors[1])-mt_rand(10,50), trim($bgcolors[2])-mt_rand(10,50)); -- 2.39.5