8000 [Validator] Email - new `allow-no-tld` mode · symfony/symfony-docs@485d57e · GitHub
[go: up one dir, main page]

Skip to content

Commit 485d57e

Browse files
guillemfondinwouterj
authored andcommitted
[Validator] Email - new allow-no-tld mode
1 parent 43f8662 commit 485d57e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

reference/constraints/Email.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,24 @@ This option defines the pattern used to validate the email address. Valid values
109109
* ``loose`` uses a simple regular expression (just checks that at least one ``@``
110110
character is present, etc.). This validation is too simple and it's recommended
111111
to use one of the other modes instead;
112-
* ``html5`` uses the same regular expression as the `HTML5 email input element`_,
113-
making the backend validation consistent with the one provided by browsers;
112+
* ``html5`` uses the regular expression of the `HTML5 email input element`_,
113+
except it enforces a tld to be present.
114+
* ``html5-allow-no-tld`` uses exactly the same regular expression as the `HTML5 email input element`_,
115+
making the backend validation consistent with the one provided by browsers.
114116
* ``strict`` validates the address according to `RFC 5322`_ using the
115117
`egulias/email-validator`_ library (which is already installed when using
116118
:doc:`Symfony Mailer </mailer>`; otherwise, you must install it separately).
117119

120+
.. versionadded:: 6.2
121+
122+
The ``html5-allow-no-tld`` mode was introduced in 6.2.
123+
118124
.. tip::
119125

120126
The possible values of this option are also defined as PHP constants of
121127
:class:`Symfony\\Component\\Validator\\Constraints\\Email`
122128
(e.g. ``Email::VALIDATION_MODE_STRICT``).
123129

124-
125130
The default value used by this option is set in the
126131
:ref:`framework.validation.email_validation_mode <reference-validation-email_validation_mode>`
127132
configuration option.

0 commit comments

Comments
 (0)
0