@@ -99,6 +99,7 @@ Configuration
99
99
* :ref: `enable_annotations <reference-validation-enable_annotations >`
100
100
* `translation_domain `_
101
101
* `strict_email `_
102
+ * `email_validation_mode `_
102
103
* :ref: `mapping <reference-validation-mapping >`
103
104
* :ref: `paths <reference-validation-mapping-paths >`
104
105
* `annotations `_
@@ -1577,10 +1578,34 @@ strict_email
1577
1578
1578
1579
**type **: ``Boolean `` **default **: ``false ``
1579
1580
1581
+ .. versionadded :: 4.1
1582
+ The ``strict_email `` option was deprecated in Symfony 4.1. Use the new
1583
+ ``email_validation_mode `` option instead.
1584
+
1580
1585
If this option is enabled, the `egulias/email-validator `_ library will be
1581
1586
used by the :doc: `/reference/constraints/Email ` constraint validator. Otherwise,
1582
1587
the validator uses a simple regular expression to validate email addresses.
1583
1588
1589
+ email_validation_mode
1590
+ .....................
1591
+
1592
+ **type **: ``string `` **default **: ``loose ``
1593
+
1594
+ .. versionadded :: 4.1
1595
+ The ``email_validation_mode `` option was introduced in Symfony 4.1.
1596
+
1597
+ It controls the way email addresses are validated by the
1598
+ :doc: `/reference/constraints/Email ` validator. The possible values are:
1599
+
1600
+ * ``loose ``, it uses a simple regular expression to validate the address (it
1601
+ checks that at least one ``@ `` character is present, etc.). This validation is
1602
+ too simple and it's recommended to use the ``html5 `` validation instead;
1603
+ * ``html5 ``, it validates email addresses using the same regular expression
1604
+ defined in the HTML5 standard, making the backend validation consistent with
1605
+ the one provided by browsers;
1606
+ * ``strict ``, it uses the `egulias/email-validator `_ library (which you must
1607
+ install separately) to validate the addresses according to the `RFC 5322 `_.
1608
+
1584
1609
.. _reference-validation-mapping :
1585
1610
1586
1611
mapping
@@ -2056,6 +2081,7 @@ Full Default Configuration
2056
2081
.. _`Security Advisory Blog post` : https://symfony.com/blog/security-releases-symfony-2-0-24-2-1-12-2-2-5-and-2-3-3-released#cve-2013-4752-request-gethost-poisoning
2057
2082
.. _`Doctrine Cache` : http://docs.doctrine-project.org/projects/doctrine-common/en/latest/reference/caching.html
2058
2083
.. _`egulias/email-validator` : https://github.com/egulias/EmailValidator
2084
+ .. _`RFC 5322` : https://tools.ietf.org/html/rfc5322
2059
2085
.. _`PhpStormProtocol` : https://github.com/aik099/PhpStormProtocol
2060
2086
.. _`phpstorm-url-handler` : https://github.com/sanduhrs/phpstorm-url-handler
2061
2087
.. _`blue/green deployment` : http://martinfowler.com/bliki/BlueGreenDeployment.html
0 commit comments