Dropping hard-coded style="display:none" in favor of custom class#56
Dropping hard-coded style="display:none" in favor of custom class#56ThomasLandauer wants to merge 1 commit into
style="display:none" in favor of custom class#56Conversation
…ble `class`
Right now, the `HoneypotType` has `style="display:none"` hard-coded. Don't you think that this is really easy to detect for spambots?
So my idea would be to use a CSS `class` for that, with a name chosen by the user. So I'd add something like this to the recipe:
```yaml
attributes:
class: 'noShow' # change this to some other name to make it harder to detect for spambots
```
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #56 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 203 203
===========================================
Files 26 26
Lines 590 590
===========================================
Hits 590 590 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I don't mind having a config option for it, but in my experience the current mechanism works fine. Hidden fields, either through `type="hidden" or CSS, are used all the time for valid reasons like remembering context for contact forms, return URLs, CSRF fields et al. So specifically a spambot has to be really smart to realize that this specific element should be left empty, while the CSRF tokens and redirect URLs should not. I'll merge the PR if done right as there is added value, but limited. |
Right now, the
HoneypotTypehasstyle="display:none"hard-coded. Don't you think that this is really easy to detect for spambots?So my idea would be to use a CSS
classfor that, with a name chosen by the user. So I'd add something like this to the recipe:What do you think?