Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with regex in Str::placeholders #37

Open
Spidlace opened this issue May 22, 2021 · 0 comments
Open

Error with regex in Str::placeholders #37

Spidlace opened this issue May 22, 2021 · 0 comments

Comments

@Spidlace
Copy link

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:

  1. Install last bolt version
  2. Install last bolt/forms version
  3. Create form with notification parameters like that :
notification:
        enabled: true
        debug: false
        debug_address: [email protected] # Email address used when debug mode is enabled
        debug_smtp: true
        subject: New contact
        subject_prefix: '[XXX]'
        to_name: 'John'
        to_email: '[email protected]'
        from_name: 'James'
        from_email: '[email protected]'
        replyto_name: lastname
        replyto_email: email
  1. 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
  1. Test form
  2. Error appear

Here a pr to fix it (works for me)

Spidlace pushed a commit to Spidlace/common that referenced this issue May 22, 2021
@Spidlace Spidlace changed the title Error with placeholders method in Str class Error with regex in Str::placeholders May 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant