Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable fieldname #56

Merged
merged 4 commits into from
Aug 24, 2017
Merged

Configurable fieldname #56

merged 4 commits into from
Aug 24, 2017

Conversation

MrJamesEllis
Copy link

This change allows for a configurable field name to be used as the name of the spam protection field.

Some modules create fields without a 'name' defined in enableSpamProtection() - resulting in the fieldname being "Captcha" which could be detected by spam bots and ignored. Allowing a configurable, nondescript field name would reduce the risk of that occurring.

@@ -74,6 +74,8 @@ public function enableSpamProtection($options = array())
// captcha form field name (must be unique)
if (isset($options['name'])) {
$name = $options['name'];
} else if($field_name = Config::inst()->get('FormSpamProtectionExtension', 'field_name')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the private static $field_name = 'Captcha'; to this class, then you can have one fewer condition. :)

@MrJamesEllis
Copy link
Author

Yep, done!

@dhensby dhensby dismissed tractorcow’s stale review August 24, 2017 10:16

Comments addressed

@dhensby dhensby merged commit ef3e6d4 into silverstripe:master Aug 24, 2017
@dhensby
Copy link
Contributor

dhensby commented Aug 24, 2017

thanks :)

@MrJamesEllis MrJamesEllis deleted the feat-configurable-fieldname branch September 3, 2017 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants