Error with regex in `Str::placeholders`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start with the placeholders method in bolt/common and reproduce the failure using the Bolt/Forms notification configuration and fields shown in the issue. Verify the regular expression's handling of replyto_email: email and replyto_name: lastname; done means the form renders without the RFC 2822 validation error.
Written by the indexing model from the issue text.
Description
Hello,
I'm reporting an error I detected when I wanted to use in Bolt/Forms extension, parameters replyto_email and replyto_name.
The form returns me an error:
"An exception has been thrown during the rendering of a template ("Email "email" does not comply with addr-spec of RFC 2822.")."
After debugging, it turns out that the error comes from bolt/common, in the placeholders method.
The regexp doesn't seem to be good at detecting the string sent to it.
Example to reproduce the bug:
- Install last bolt version
- Install last bolt/forms version
- Create form with notification parameters like that :
notification:
enabled: true
debug: false
debug_address: name@example.com # Email address used when debug mode is enabled
debug_smtp: true
subject: New contact
subject_prefix: '[XXX]'
to_name: 'John'
to_email: 'john.doe@example.com'
from_name: 'James'
from_email: 'james.bond@example.com'
replyto_name: lastname
replyto_email: email
- Add two fields
lastname:
type: text
fieldLabel: Nom
options:
required: true
label: Lastname
constraints: [ NotBlank ]
attr:
placeholder: Nom
email:
type: email
fieldLabel: Email
options:
required: true
constraints: [ NotBlank, Email ]
attr:
placeholder: Email
- Test form
- Error appear
Here a pr to fix it (works for me)
- Dominant language
- PHP
- Stars
- 18
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·