[php-blog-cvs] r2555 - trunk/plugins/serendipity_event_spamblock
A reliable, secure & extensible PHP blog | Not mainstream since 2002
Brought to you by:
garvinhicking,
jhermanns
From: brockhaus at B. <bro...@ma...> - 2009-07-15 10:57:56
|
Author: brockhaus Date: 2009-07-15 12:57:42 +0200 (Wed, 15 Jul 2009) New Revision: 2555 Modified: trunk/plugins/serendipity_event_spamblock/lang_de.inc.php trunk/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php Log: * Commented out DEBUG logs of Akismet, that blow up the spamblocklog table * Reporting of correct comment type for Akismet calls (pingback or trackback) Modified: trunk/plugins/serendipity_event_spamblock/lang_de.inc.php =================================================================== --- trunk/plugins/serendipity_event_spamblock/lang_de.inc.php 2009-07-15 10:49:16 UTC (rev 2554) +++ trunk/plugins/serendipity_event_spamblock/lang_de.inc.php 2009-07-15 10:57:42 UTC (rev 2555) @@ -102,7 +102,7 @@ @define('PLUGIN_EVENT_SPAMBLOCK_TRACKBACKURL', 'Trackbacks/Pingbacks: URLS pr; @define('PLUGIN_EVENT_SPAMBLOCK_TRACKBACKURL_DESC', 'Einen API Kommentar (Trackback/Pingback) nur dann zulassen, wenn Ihre URL auch auf der Zielseite genannt wird.'); -@define('PLUGIN_EVENT_SPAMBLOCK_REASON_TRACKBACKURL', 'API-Kommentar - URL ung'); +@define('PLUGIN_EVENT_SPAMBLOCK_REASON_TRACKBACKURL', 'API-Kommentar - Blog URL nicht gefunden.'); @define('PLUGIN_EVENT_SPAMBLOCK_FORCEMODERATION_TREAT', 'Was soll mit auto-moderierten Kommentaren passieren?'); @define('PLUGIN_EVENT_SPAMBLOCK_FORCEMODERATIONT_TREAT', 'Was soll mit auto-moderierten Trackbacks/Pingbacks passieren?'); @define('PLUGIN_EVENT_SPAMBLOCK_FORCEMODERATIONT', 'Trackback/Pingbackmoderation nach wievielen Tagen erzwingen'); Modified: trunk/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php =================================================================== --- trunk/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php 2009-07-15 10:49:16 UTC (rev 2554) +++ trunk/plugins/serendipity_event_spamblock/serendipity_event_spamblock.php 2009-07-15 10:57:42 UTC (rev 2555) @@ -476,7 +476,8 @@ switch($where) { case 'akismet.com': - $this->log($this->logfile, $eventData['id'], 'AKISMET_SAFETY', 'Akismet verification takes place', $addData); + // DEBUG + //$this->log($this->logfile, $eventData['id'], 'AKISMET_SAFETY', 'Akismet verification takes place', $addData); $ret = array(); $data = array( 'blog' => $serendipity['baseURL'], @@ -484,7 +485,7 @@ 'referrer' => $_SERVER['HTTP_REFERER'], 'user_ip' => $_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR') ? $_SERVER['REMOTE_ADDR'] : getenv('HTTP_X_FORWARDED_FOR'), 'permalink' => serendipity_archiveURL($eventData['id'], $eventData['title'], 'serendipityHTTPPath', true, array('timestamp' => $eventData['timestamp'])), - 'comment_type' => ($addData['type'] == 'NORMAL' ? 'comment' : 'trackback'), + 'comment_type' => ($addData['type'] == 'NORMAL' ? 'comment' : strtolower($addData['type'])), // second: pingback or trackback. 'comment_author' => $addData['name'], 'comment_author_email' => $addData['email'], 'comment_author_url' => $addData['url'], @@ -531,7 +532,8 @@ $ret['message'] = 'No server for Akismet request'; break; } else { - $this->log($this->logfile, $eventData['id'], 'AKISMET_SERVER', 'Using Akismet server at ' . $server, $addData); + // DEBUG + //$this->log($this->logfile, $eventData['id'], 'AKISMET_SERVER', 'Using Akismet server at ' . $server, $addData); } $req = new HTTP_Request( 'http://' . $server . '/1.1/verify-key', @@ -580,11 +582,13 @@ if (preg_match('@true@i', $reqdata)) { $ret['is_spam'] = true; $ret['message'] = $reqdata; - $this->log($this->logfile, $eventData['id'], 'AKISMET_SPAM', 'Akismet API returned spam', $addData); + // DEBUG + //$this->log($this->logfile, $eventData['id'], 'AKISMET_SPAM', 'Akismet API returned spam', $addData); } elseif (preg_match('@false@i', $reqdata)) { $ret['is_spam'] = false; $ret['message'] = $reqdata; - $this->log($this->logfile, $eventData['id'], 'AKISMET_PASS', 'Passed Akismet verification', $addData); + // DEBUG + //$this->log($this->logfile, $eventData['id'], 'AKISMET_PASS', 'Passed Akismet verification', $addData); } else { $ret['is_spam'] = false; $ret['message'] = 'Akismet API failure'; |