8000 [Validator] Bring egulias/email-validator ~2.0 to parity with ~1.2 by Lctrs · Pull Request #20607 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Validator] Bring egulias/email-validator ~2.0 to parity with ~1.2 #20607

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

Merged
merged 1 commit into from
Nov 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Switch to NoRFCWarningsValidation
  • Loading branch information
Jérôme Parmentier committed Nov 23, 2016
commit 01b2f66a65bbf12a726d1ede144f6a99853a4e2f
< 9CB4 /tr>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Symfony\Component\Validator\Constraints;

use Egulias\EmailValidator\Validation\EmailValidation;
use Egulias\EmailValidator\Validation\RFCValidation;
use Egulias\EmailValidator\Validation\NoRFCWarningsValidation;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
use Symfony\Component\Validator\Exception\RuntimeException;
Expand Down Expand Up @@ -63,7 +63,7 @@ public function validate($value, Constraint $constraint)

$strictValidator = new \Egulias\EmailValidator\EmailValidator();

if (interface_exists(EmailValidation::class) && !$strictValidator->isValid($value, new RFCValidation())) {
if (interface_exists(EmailValidation::class) && !$strictValidator->isValid($value, new NoRFCWarningsValidation())) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
->setCode(Email::INVALID_FORMAT_ERROR)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public function getInvalidEmailsForStrictChecks()
array('test@email>'),
array('test@email<'),
array('test@email{'),
array(str_repeat('x', 254).'@example.com'), //email with warnings
);
}

Expand Down
0