Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

MathSpamProtection in SilverStripe3 - pulls and suggestions


Reply

2 Posts   266 Views

Avatar
martimiz

11 July 2012 at 12:42am (Last edited: 11 July 2012 12:43am), Forum Moderator, 1091 Posts

Hi Will,

I sent some pullrequests regarding languages and fixes for deprecation notices in the MathSpamProtection module. So far the module seems to be working for me in SS3, even though it states in that built-in validation doesn't work?

Suggestion
Enabling jQuery validation for the Captcha field (required), I stumbled upon the following issue: it seems the plugin conflicts with Google Toolbar Autofill, so that instead of showing a 'this is a required field' message, it shows the input title. A remedy would be to set the Fields title to empty. Would that be acceptable? an alternative would be to use javascript to empty the title attribute...

function Field($properties = array()) {
   if(self::is_enabled($properties = array())) {
      $attributes = array(
         ...
         'title' => $this->Title(), <-- Becomes: 'title' => '',
         ...
      );
      return $this->createTag('input', $attributes);
   }
}

Also I'd be interested in adding the Form ID to the session cookie, so MathSpamProtection can be used on multiple forms on the same page (having different form ID's). Would you be interested in a pull request for that as well?

Martine

Avatar
martimiz

11 July 2012 at 6:29am Forum Moderator, 1091 Posts

OK - as to working on multiple forms on the same page - that is not something the MathSpamProtector is responsible for, I guess. It works perfectly as long as the right form is parsed on submit, not just the first form on the page :-)