Spam Protector plugin - CAPTCHA case sensitivity

Creating and modifying plugins.
Post Reply
akremedy
Regular
Posts: 56
Joined: Sat Jul 26, 2008 9:06 am
Location: Bay Area, U.S.A.
Contact:

Spam Protector plugin - CAPTCHA case sensitivity

Post by akremedy »

I fear I must have overlooked something, but cannot seem to find a variable/config setting anywhere that controls case sensitivity in CAPTCHA strings for the Spam Protector plugin.

By default, it seems that Spam Protector expects all upper-case text, however entered as such, the string is not validated.

I remedied this easily enough by modifying the CAPTCHA alpha character array to lower case:

Code: Select all

$this->chars = array_merge($this->chars, array('a','b','c','d','e','f','h','j','k','m','n','p','r','t','u','v','w','x','y','z'));
I doubt I'll change it now, but I'm curious to know what I might be missing...

Thanks,
Adam
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Spam Protector plugin - CAPTCHA case sensitivity

Post by garvinhicking »

Hi!

The comparison of the captcha string is actually case independent:

Code: Select all

... || strtolower($serendipity['POST']['captcha']) != strtolower($_SESSION['spamblock']['captcha'])) {
so this shouldn't matter at all what the user uses for the case...

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/
akremedy
Regular
Posts: 56
Joined: Sat Jul 26, 2008 9:06 am
Location: Bay Area, U.S.A.
Contact:

Re: Spam Protector plugin - CAPTCHA case sensitivity

Post by akremedy »

Thanks Garvin, yes this made it all the stranger - I spotted where it looks like everything is converted strtolower, but still, CAPTCHA fails with upper, and passes with lower.

If I can, I'll look into it a little further, but it could be awhile before I get around to it...if this was affecting everyone, surely there would be plenty of reports already, and I didn't find anything in the forums; therefore, until proven otherwise, I'm assuming it's something odd with my install/configuration.

Thanks,
Adam
Post Reply