-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Closed
Description
Symfony version(s) affected: any?
Description
As warned in the comment to checkdnsrr() docs, one should pass a fully qualified domain name to get correct results, i.e. symfony.com. instead of symfony.com
99.9% of the time users do not put a dot at the end of their email which leads to incorrect checks.
Possible Solution without breaking BC
- Add a config value
framework.validation.make_host_absolute = null(likeframework.validation.make_host_absolute). If not set explicitly totrueorfalsea deprecation is shown:Not setting a value explicitly is deprecated. Will be true by default since 5.0. - Add
EmailValidator::__construct(..., ?bool $makeHostAbsolute = null)with same BC logic. - Add
@Email::?bool $makeHostAbsolute = nullto be able to override validator's default value when needed. if ($makeHostAbsolute && '.' !== mb_substr($email, -1)) { $email .= '.'; }
Ready to work on the PR.