In #2874151: Captcha + Panels + Page Manager + Webform : The answer you entered for the CAPTCHA was not correct. and #3061067: Captcha-answer=hash value? the same issue was fixed by a different approach, both patches were committed. This results in the return of the issue.
For forms with a form ID containing a dash and the form containing a CAPTCHA element, the provided answer always is not correct, because the solution is reset when the stored form ID and submitted/posted form ID do not match.
The form IDs are 'cleaned' by a regex, which regex is different in both places:
Posted form ID:
$posted_form_id = isset($input['form_id']) ?
preg_replace("/[^a-z0-9_-]/", "", (string) $input['form_id'])
: NULL;
Stored form ID:
$this_form_id = isset($complete_form['form_id']['#value']) ?
preg_replace("/[^a-z0-9_]/", "", (string) $complete_form['form_id']['#value'])
: NULL;
Will provide a patch shortly.
Comments
Comment #2
sjerdoComment #3
sjerdoComment #4
adamps commentedThanks for the patch, that works for me.
This is a nasty bug that can make significant parts of a site unusable so it would be great to get it committed.
Comment #5
lamp5Thx, the patch works perfect!
Comment #7
japerryComment #8
adamps commentedGreat thanks