Skip to content

Commit de66ba1

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Mailer] Remove some duplicated contents
2 parents c9c895c + 3c08b67 commit de66ba1

File tree

2 files changed

+20
-35
lines changed

2 files changed

+20
-35
lines changed

reference/configuration/framework.rst

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,22 +2620,15 @@ metadata of the class. You can define an array of strings with the names of
26202620
several methods. In that case, all of them will be called in that order to load
26212621
the metadata.
26222622

2623+
.. _reference-validation-email_validation_mode:
2624+
26232625
email_validation_mode
26242626
.....................
26252627

26262628
**type**: ``string`` **default**: ``loose``
26272629

2628-
Sets the default value for
2629-
:doc:`/reference/constraints/Email` validator. The possible values are:
2630-
2631-
* ``loose``, it uses a simple regular expression to validate the address (it
2632-
checks that at least one ``@`` character is present, etc.). This validation is
2633-
too simple and it's recommended to use the ``html5`` validation instead;
2634-
* ``html5``, it validates email addresses using the same regular expression
2635-
defined in the HTML5 standard, making the backend validation consistent with
2636-
the one provided by browsers;
2637-
* ``strict``, it uses the `egulias/email-validator`_ library (which you must
2638-
install separately) to validate the addresses according to the `RFC 5322`_.
2630+
Sets the default value for the
2631+
:ref:`mode option of the Email validator <reference-constraint-email-mode>`.
26392632

26402633
.. _reference-validation-mapping:
26412634

@@ -3506,8 +3499,6 @@ to know their differences.
35063499

35073500
.. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
35083501
.. _`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
3509-
.. _`egulias/email-validator`: https://github.com/egulias/EmailValidator
3510-
.. _`RFC 5322`: https://tools.ietf.org/html/rfc5322
35113502
.. _`PhpStormProtocol`: https://github.com/aik099/PhpStormProtocol
35123503
.. _`phpstorm-url-handler`: https://github.com/sanduhrs/phpstorm-url-handler
35133504
.. _`blue/green deployment`: https://martinfowler.com/bliki/BlueGreenDeployment.html

reference/constraints/Email.rst

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,28 @@ Parameter Description
119119
``{{ label }}`` Corresponding form field label
120120
=============== ==============================================================
121121

122+
.. _reference-constraint-email-mode:
123+
122124
``mode``
123125
~~~~~~~~
124126

125-
**type**: ``string`` **default**: ``loose``
126-
127-
This option is optional and defines the pattern the email address is validated against.
128-
Valid values are:
129-
130-
* ``loose``
131-
* ``strict``
132-
* ``html5``
133-
134-
``loose``
135-
.........
136-
137-
A simple regular expression. Allows all values with an "@" symbol in, and a "."
138-
in the second host part of the email address.
139-
140-
``strict``
141-
..........
127+
**type**: ``string`` **default**: (see below)
142128

143-
Uses the `egulias/email-validator`_ library to perform an RFC compliant
144-
validation. You will need to install that library to use this mode.
129+
This option is optional and defines the pattern used to validate the email
130+
address. Valid values are:
145131

146-
``html5``
147-
.........
132+
* ``loose``, it uses a simple regular expression to validate the address (it
133+
checks that at least one ``@`` character is present, etc.). This validation is
134+
too simple and it's recommended to use the ``html5`` validation instead;
135+
* ``html5``, it validates email addresses using the same regular expression
136+
as the `HTML5 email input element`_, making the backend validation consistent
137+
with the one provided by browsers;
138+
* ``strict``, it uses the `egulias/email-validator`_ library (which you must
139+
install separately) to validate the addresses according to the `RFC 5322`_.
148140

149-
This matches the pattern used for the `HTML5 email input element`_.
141+
The default value used by this option is set in the
142+
:ref:`framework.validation.email_validation_mode <reference-validation-email_validation_mode>`
143+
configuration option.
150144

151145
.. include:: /reference/constraints/_normalizer-option.rst.inc
152146

0 commit comments

Comments
 (0)