1
1
Hostname
2
2
========
3
3
4
- This constraint ensures that the given value is a valid and non-reserved
5
- host name (internally it uses the ``FILTER_VALIDATE_DOMAIN `` option of the
6
- :phpfunction: ` filter_var ` PHP function).
4
+ This constraint ensures that the given value is a valid host name (internally it
5
+ uses the ``FILTER_VALIDATE_DOMAIN `` option of the :phpfunction: ` filter_var ` PHP
6
+ function).
7
7
8
8
.. versionadded :: 5.1
9
9
@@ -29,7 +29,7 @@ will contain a host name.
29
29
30
30
.. code-block :: php-annotations
31
31
32
- // src/Entity/Server .php
32
+ // src/Entity/ServerSettings .php
33
33
namespace App\Entity;
34
34
35
35
use Symfony\Component\Validator\Constraints as Assert;
@@ -86,9 +86,9 @@ will contain a host name.
86
86
}
87
87
}
88
88
89
- The following TLD are reserved according to `RFC 2606 `_ and that's why hostnames
90
- containing them are not considered valid: ``.example ``, `` .invalid ``, `` .localhost ``,
91
- ``.test ``.
89
+ The following top-level domains ( TLD) are reserved according to `RFC 2606 `_ and
90
+ that's why hostnames containing them are not considered valid: ``.example ``,
91
+ ``.invalid ``, `` .localhost ``, and `` . test ``.
92
92
93
93
.. include :: /reference/constraints/_empty-values-are-valid.rst.inc
94
94
@@ -120,16 +120,16 @@ Parameter Description
120
120
**type **: ``bool `` **default **: ``true ``
121
121
122
122
By default, hostnames are considered valid only when they are fully qualified
123
- and include the their TLDs (top-level domain names). For instance,
124
- `` example.com `` is valid by ``example `` is not.
123
+ and include their TLDs (top-level domain names). For instance, `` example.com ``
124
+ is valid but ``example `` is not.
125
125
126
126
Set this option to ``false `` to not require any TLD in the hostnames.
127
127
128
128
.. note ::
129
129
130
130
This constraint does not validate that the given TLD value is included in
131
131
the `list of official top-level domains `_ (because that list is growing
132
- continuously and it's nearly impossible to keep track of it).
132
+ continuously and it's hard to keep track of it).
133
133
134
134
.. _`RFC 2606` : https://tools.ietf.org/html/rfc2606
135
- .. _`full list of official top-level domains` : https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
135
+ .. _`list of official top-level domains` : https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
0 commit comments