I discovered that the honeypot fields weren't being added to webform client form, so I took a look at the code and it appears that code has been written only for adding honeypot to node forms, comment forms and general forms (user_register,user_pass). So with node forms code, honeypot is working on webform node form but not on the webform client forms (which site user gets to fill).
So I wrote code for it which worked for me so I am submitting my patch

Comments

geerlingguy’s picture

Title: Honeypot not being added to webform client forms » Allow Honeypot to work with webform forms
Version: 6.x-1.8 » 6.x-1.x-dev
Category: bug » feature
Status: Active » Needs review

Thanks for the patch! I haven't been using Honeypot on any webform-enabled sites lately, so I'll try to test this and make sure it works on D6 (and then D7... which will be different), then commit it.

geerlingguy’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Needs work

Patches go into D7 first, but it looks like it shouldn't be too difficult to get this working in both D6 and D7 at the same time...

(Also, marked #1377860: Drupal 7 Webform support as a duplicate. Patch there for D7.

geerlingguy’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB

I'm taking a little different tack here, mostly for performance reasons—the elseif check should be a tiny bit faster, and would be cached on most sites so PHP would just need to run through the check once for each enabled form (if it doesn't match the first condition).

I may someday rewrite the integration for modules like Webform, simply because webform requires a little more work in the processing power department (strpos() is a lot more intense than simply checking a value for each checked form type). But probably not... this probably wouldn't make more than a 2-4ms difference on a normal page load :)

Attached patch works with D7 / Webform 3.15 (and earlier). Will work on making sure D6 backport works well too.

geerlingguy’s picture

StatusFileSize
new1.93 KB

Geica! Forgot to take out my first idea; that would've been double-trouble. Fixed patch attached. Will commit to D7.

geerlingguy’s picture

Status: Needs review » Patch (to be ported)
geerlingguy’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Needs review
StatusFileSize
new1.63 KB

D6 backport (almost exactly the same) attached. Will commit in a minute, and mark this fixed. New release to be posted soon!

geerlingguy’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.