Skip to content

[Mailer] Remove some duplicated contents #15850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2710,22 +2710,15 @@ metadata of the class. You can define an array of strings with the names of
several methods. In that case, all of them will be called in that order to load
the metadata.

.. _reference-validation-email_validation_mode:

email_validation_mode
.....................

**type**: ``string`` **default**: ``loose``

Sets the default value for
:doc:`/reference/constraints/Email` validator. The possible values are:

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

.. _reference-validation-mapping:

Expand Down Expand Up @@ -3619,8 +3612,6 @@ to know their differences.
.. _`HTTP Host header attacks`: https://www.skeletonscribe.net/2013/05/practical-http-host-header-attacks.html
.. _`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
.. _`Doctrine Cache`: https://www.doctrine-project.org/projects/doctrine-cache/en/current/index.html
.. _`egulias/email-validator`: https://github.com/egulias/EmailValidator
.. _`RFC 5322`: https://tools.ietf.org/html/rfc5322
.. _`PhpStormProtocol`: https://github.com/aik099/PhpStormProtocol
.. _`phpstorm-url-handler`: https://github.com/sanduhrs/phpstorm-url-handler
.. _`blue/green deployment`: https://martinfowler.com/bliki/BlueGreenDeployment.html
Expand Down
38 changes: 16 additions & 22 deletions reference/constraints/Email.rst
Original file line number Diff line number Diff line change
Expand Up @@ -123,34 +123,28 @@ Parameter Description

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

.. _reference-constraint-email-mode:

``mode``
~~~~~~~~

**type**: ``string`` **default**: ``loose``

This option is optional and defines the pattern the email address is validated against.
Valid values are:

* ``loose``
* ``strict``
* ``html5``

``loose``
.........

A simple regular expression. Allows all values with an "@" symbol in, and a "."
in the second host part of the email address.

``strict``
..........
**type**: ``string`` **default**: (see below)

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

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

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

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

Expand Down