Skip to content

Commit 9dc48bf

Browse files
committed
minor #15850 [Mailer] Remove some duplicated contents (javiereguiluz)
This PR was merged into the 5.3 branch. Discussion ---------- [Mailer] Remove some duplicated contents Fixes #15295. Commits ------- 1577c2d [Mailer] Remove some duplicated contents
2 parents 1a7bc4f + 1577c2d commit 9dc48bf

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
@@ -2710,22 +2710,15 @@ metadata of the class. You can define an array of strings with the names of
27102710
several methods. In that case, all of them will be called in that order to load
27112711
the metadata.
27122712

2713+
.. _reference-validation-email_validation_mode:
2714+
27132715
email_validation_mode
27142716
.....................
27152717

27162718
**type**: ``string`` **default**: ``loose``
27172719

2718-
Sets the default value for
2719-
:doc:`/reference/constraints/Email` validator. The possible values are:
2720-
2721-
* ``loose``, it uses a simple regular expression to validate the address (it
2722-
checks that at least one ``@`` character is present, etc.). This validation is
2723-
too simple and it's recommended to use the ``html5`` validation instead;
2724-
* ``html5``, it validates email addresses using the same regular expression
2725-
defined in the HTML5 standard, making the backend validation consistent with
2726-
the one provided by browsers;
2727-
* ``strict``, it uses the `egulias/email-validator`_ library (which you must
2728-
install separately) to validate the addresses according to the `RFC 5322`_.
2720+
Sets the default value for the
2721+
:ref:`mode option of the Email validator <reference-constraint-email-mode>`.
27292722

27302723
.. _reference-validation-mapping:
27312724

@@ -3619,8 +3612,6 @@ to know their differences.
36193612
.. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
36203613
.. _`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
36213614
.. _`Doctrine Cache`: https://www.doctrine-project.org/projects/doctrine-cache/en/current/index.html
3622-
.. _`egulias/email-validator`: https://github.com/egulias/EmailValidator
3623-
.. _`RFC 5322`: https://tools.ietf.org/html/rfc5322
36243615
.. _`PhpStormProtocol`: https://github.com/aik099/PhpStormProtocol
36253616
.. _`phpstorm-url-handler`: https://github.com/sanduhrs/phpstorm-url-handler
36263617
.. _`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
@@ -123,34 +123,28 @@ Parameter Description
123123

124124
The ``{{ label }}`` parameter was introduced in Symfony 5.2.
125125

126+
.. _reference-constraint-email-mode:
127+
126128
``mode``
127129
~~~~~~~~
128130

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

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

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

153-
This matches the pattern used for the `HTML5 email input element`_.
145+
The default value used by this option is set in the
146+
:ref:`framework.validation.email_validation_mode <reference-validation-email_validation_mode>`
147+
configuration option.
154148

155149
.. include:: /reference/constraints/_normalizer-option.rst.inc
156150

0 commit comments

Comments
 (0)