8000 [Validator] Use same validation pattern for `Assert\Email` as Mailer is using for `new Address()` · Issue #41850 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Validator] Use same validation pattern for Assert\Email as Mailer is using for new Address() #41850
Closed
@ThomasLandauer

Description

@ThomasLandauer

Description
When entering foo..bar@example.com into a form field with @Assert\Email(), this is considered valid.
However, new Address('foo..bar@example.com'); results in the RfcComplianceException:

Email "foo..bar@example.com" does not comply with addr-spec of RFC 2822.

I know that email validation is a difficult topic ;-) But it cannot (or rather should not) be that one part of Symfony is accepting something, and another part is refusing it.

So I'm suggesting:

  • Add the same pattern that Address() is using as mode for Assert\Email.
  • And set this new mode as the default.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0