Skip to content
Permalink
Browse files

Disable bodyclone spamblock option by default, disable for comments

  • Loading branch information...
onli committed Mar 18, 2019
1 parent 92a1106 commit b6cbaee3395c55fe6ffaa3bbaf4769dce6b1edae
Showing with 5 additions and 3 deletions.
  1. +2 −0 docs/NEWS
  2. +3 −3 plugins/serendipity_event_spamblock/serendipity_event_spamblock.php
@@ -1,6 +1,8 @@

Version 2.2.1-alpha2 ()
------------------------------------------------------------------------
* Allow to receive multiple trackbacks and pingbacks

* Fallback for $lang variable when configuration failed to load,
which evades some unuseful error messages (thanks @HQJaTu!)

@@ -25,7 +25,7 @@ function introspect(&$propbag)
'smarty' => '2.6.7',
'php' => '4.1.0'
));
$propbag->add('version', '1.87');
$propbag->add('version', '1.88');
$propbag->add('event_hooks', array(
'frontend_saveComment' => true,
'external_plugin' => true,
@@ -226,7 +226,7 @@ function introspect_config_item($name, &$propbag)
$propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE);
$propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE_DESC);
$propbag->add('default', true);
$propbag->add('default', false);
break;
case 'captchas':
@@ -1160,7 +1160,7 @@ function event_hook($event, &$bag, &$eventData, $addData = null)
}
// Check for identical comments. We allow to bypass trackbacks from our server to our own blog.
if ( $this->get_config('bodyclone', true) === true && $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] && $addData['type'] != 'PINGBACK') {
if ( $this->get_config('bodyclone', false) === true && $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] && $addData['type'] == 'NORMAL') {
$query = "SELECT count(id) AS counter FROM {$serendipity['dbPrefix']}comments WHERE type = '" . $addData['type'] . "' AND body = '" . serendipity_db_escape_string($addData['comment']) . "'";
$row = serendipity_db_query($query, true);
if (is_array($row) && $row['counter'] > 0) {

0 comments on commit b6cbaee

Please sign in to comment.
You can’t perform that action at this time.