You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Egulias\EmailValidator\EmailValidator is not really perfect (toto@toto.___c is valid whereas it's not for HTML5 or filter_var), so I propose to use filter_var with FILTER_VALIDATE_EMAIL if Egulias is not installed:
EmailValidator:
if (!class_exists('\Egulias\EmailValidator\EmailValidator')) {
if (filter_var($value, FILTER_VALIDATE_EMAIL) === false) {
$this->context->buildViolation($constraint->message)
->setParameter('{{ value }}', $this->formatValue($value))
->setCode(Email::INVALID_FORMAT_ERROR)
->addViolation();
return;
}
}
The text was updated successfully, but these errors were encountered:
Having the behavior of the constraint change based on the presence of a dependency looks like a bad idea.
We could add another validation mode that is based on FILTER_VALIDATE_EMAIL but I'm not sure if it's worth it since FILTER_VALIDATE_EMAIL doesn't match any standard (that's why we stopped using it).
Egulias\EmailValidator\EmailValidator
is not really perfect (toto@toto.___c
is valid whereas it's not for HTML5 or filter_var), so I propose to usefilter_var
withFILTER_VALIDATE_EMAIL
if Egulias is not installed:EmailValidator:
The text was updated successfully, but these errors were encountered: