Bug in spamblock logging?

Found a bug? Tell us!!
Post Reply
greenwayg
Regular
Posts: 34
Joined: Wed Jan 02, 2008 8:25 pm

Bug in spamblock logging?

Post by greenwayg »

I use the spamblock plugin with akismet, and I log to a file. I think I found a bug in the text put into the log file.

From serendipity_event_spamblock.php line 508:

Code: Select all

if (preg_match('@true@i', $reqdata)) {
   $ret['is_spam'] = true;
   $ret['message'] = $reqdata;
   $this->log($this->logfile, $eventData['id'], 'AKISMET_PASS', 'Passed Akismet verification', $addData);
} elseif (preg_match('@false@i', $reqdata)) {
   $ret['is_spam'] = false;
   $ret['message'] = $reqdata;
   $this->log($this->logfile, $eventData['id'], 'AKISMET_SPAM', 'Akismet API returned spam', $addData);
I think the strings for AKISMET_PASS and AKISMET_SPAM are reversed. We write "Akismet API returned spam" in the case where we set $ret['is_spam'] = false. Note that the only problem here is in the logfile. Comments are correctly rejected/moderated or accepted based on the akismet reply, but my logfile looks very confusing.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Bug in spamblock logging?

Post by garvinhicking »

Hi!

Good catch, indeed the output messages were flipped. I just committed the fix to SVN.

Thanks a lot!

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply