1
0

* Change "Allow duplicate content" in spamblock plugin to not

operate on (empty) pingbacks (garvinhicking)
This commit is contained in:
Garvin Hicking
2009-01-13 18:00:26 +00:00
parent 0498ba3327
commit c31a8dd7b9
2 changed files with 7 additions and 3 deletions

View File

@ -6,6 +6,9 @@ Version 1.5 ()
Version 1.4.1 () Version 1.4.1 ()
------------------------------------------------------------------------ ------------------------------------------------------------------------
* Change "Allow duplicate content" in spamblock plugin to not
operate on (empty) pingbacks (garvinhicking)
* Upgrade to Smarty 2.6.22 to fix a PCRE bug * Upgrade to Smarty 2.6.22 to fix a PCRE bug
* Remove warning message when checking for plugin documentation files * Remove warning message when checking for plugin documentation files

View File

@ -734,10 +734,11 @@ var $filter_defaults;
break; break;
case 'frontend_saveComment': case 'frontend_saveComment':
/*
$fp = fopen('/tmp/spamblock2.log', 'a'); $fp = fopen('/tmp/spamblock2.log', 'a');
fwrite($fp, date('Y-m-d H:i') . "\n" . print_r($eventData, true) . "\n" . print_r($addData, true) . "\n"); fwrite($fp, date('Y-m-d H:i') . "\n" . print_r($eventData, true) . "\n" . print_r($addData, true) . "\n");
fclose($fp); fclose($fp);
*/
if (!is_array($eventData) || serendipity_db_bool($eventData['allow_comments'])) { if (!is_array($eventData) || serendipity_db_bool($eventData['allow_comments'])) {
$this->checkScheme(); $this->checkScheme();
@ -1110,8 +1111,8 @@ var $filter_defaults;
} }
// 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']) { if ( $this->get_config('bodyclone', true) === true && $_SERVER['REMOTE_ADDR'] != $_SERVER['SERVER_ADDR'] && $addData['type'] != 'PINGBACK') {
$query = "SELECT count(id) AS counter FROM {$serendipity['dbPrefix']}comments WHERE 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) {
$this->IsHardcoreSpammer(); $this->IsHardcoreSpammer();