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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

MathSpamProtection in SilverStripe3 - pulls and suggestions


Go to End


2 Posts   669 Views

Avatar
martimiz

Forum Moderator, 1391 Posts

11 July 2012 at 12:42am

Edited: 11/07/2012 12:43am

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

Forum Moderator, 1391 Posts

11 July 2012 at 6:29am

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 :-)