Skip to content

Commit

Permalink
Disable bodyclone spamblock option by default, disable for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
onli committed Mar 18, 2019
1 parent 92a1106 commit b6cbaee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/NEWS
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,8 @@


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

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


Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function introspect(&$propbag)
'smarty' => '2.6.7', 'smarty' => '2.6.7',
'php' => '4.1.0' 'php' => '4.1.0'
)); ));
$propbag->add('version', '1.87'); $propbag->add('version', '1.88');
$propbag->add('event_hooks', array( $propbag->add('event_hooks', array(
'frontend_saveComment' => true, 'frontend_saveComment' => true,
'external_plugin' => true, 'external_plugin' => true,
Expand Down Expand Up @@ -226,7 +226,7 @@ function introspect_config_item($name, &$propbag)
$propbag->add('type', 'boolean'); $propbag->add('type', 'boolean');
$propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE); $propbag->add('name', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE);
$propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE_DESC); $propbag->add('description', PLUGIN_EVENT_SPAMBLOCK_BODYCLONE_DESC);
$propbag->add('default', true); $propbag->add('default', false);
break; break;


case 'captchas': case 'captchas':
Expand Down Expand Up @@ -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. // 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']) . "'"; $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); $row = serendipity_db_query($query, true);
if (is_array($row) && $row['counter'] > 0) { if (is_array($row) && $row['counter'] > 0) {
Expand Down

0 comments on commit b6cbaee

Please sign in to comment.