Skip to content

Commit

Permalink
Merge branch '3.2'
Browse files Browse the repository at this point in the history
* 3.2:
  Switch to NoRFCWarningsValidation
  • Loading branch information
nicolas-grekas committed Nov 29, 2016
2 parents 2cdc6d2 + 0e12427 commit e765849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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
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 comments on commit e765849

Please sign in to comment.