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

Not correct email validation #20309

Closed
Nidhognit opened this issue Oct 26, 2016 · 6 comments
Closed

Not correct email validation #20309

Nidhognit opened this issue Oct 26, 2016 · 6 comments

Comments

@Nidhognit
Copy link

Nidhognit commented Oct 26, 2016

Error:
In fom, user write email "test.@gmail.com", and form validation say 'valid', but i cant send message for this email, they is does not comply with RFC 2822, 3.6.2.

Form example:

            ->add('email', 'email', [
                    'required' => true,
                    'constraints' => [new NotBlank(), new Email()]
                ]
            )

System information:
Ubuntu 14, php 7.0.12, Symfony 2.8.12.

@xabbuh
Copy link
Member

xabbuh commented Oct 26, 2016

@Nidhognit Do you mean you experience what is described in #19359?

@jeremyFreeAgent
Copy link
Contributor

Have you required egulias/email-validator?

@linaori
Copy link
Contributor

linaori commented Oct 27, 2016

The default validation of the Email validator does not do an extensive regex, it merely checks if the @ is present.

@dosten
Copy link
Contributor

dosten commented Nov 3, 2016

Since there are a lot of issues about this topic, why not open again the discussion to have a hard dependency on egulias/email-validator?

@sfarkas1988
Copy link

The email validator is useless from my point of view without strict mode.
The following email patterns are valid when using the email validator with default option:

        $validator = $this->getContainer()->get('validator');
        $emails = array(
            'xx@xx@virgilio.it',
            'xxx.mari@gmal..com',
            'xx.xx @alice.i',
            'xx.xx@gmal..com',
            'xx@hotmail.com;xxx.tgn.xxx@gencat.cat',
            'XXXX08@GMAIL.COM; XXXX@HUBU.ES'
        );

        foreach ($emails as $email) {
            var_dump($validator->validate($email, new Email()));
        }

@xabbuh
Copy link
Member

xabbuh commented Dec 16, 2016

Is there anything left to do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants