Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
captcha
Commits
162bb5d1
Commit
162bb5d1
authored
Apr 22, 2021
by
sjerdo
Committed by
Jakob Perry
Apr 22, 2021
Browse files
Issue #3152792 by sjerdo: Solution is reset for form IDs containing a dash
parent
483dfcf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Element/Captcha.php
View file @
162bb5d1
...
@@ -101,7 +101,7 @@ class Captcha extends FormElement implements ContainerFactoryPluginInterface {
...
@@ -101,7 +101,7 @@ class Captcha extends FormElement implements ContainerFactoryPluginInterface {
// Get the form ID of the form we are currently processing (which is not
// Get the form ID of the form we are currently processing (which is not
// necessary the same form that is submitted (if any).
// necessary the same form that is submitted (if any).
$this_form_id
=
isset
(
$complete_form
[
'form_id'
][
'#value'
])
?
$this_form_id
=
isset
(
$complete_form
[
'form_id'
][
'#value'
])
?
preg_replace
(
"/[^a-z0-9_]/"
,
""
,
(
string
)
$complete_form
[
'form_id'
][
'#value'
])
preg_replace
(
"/[^a-z0-9_
-
]/"
,
""
,
(
string
)
$complete_form
[
'form_id'
][
'#value'
])
:
NULL
;
:
NULL
;
// Get the CAPTCHA session ID.
// Get the CAPTCHA session ID.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment