Skip to content

Commit 057466d

Browse files
committed
minor #21406 [Validator] rework the usage of '*' for the protocols option (xabbuh)
This PR was merged into the 7.4 branch. Discussion ---------- [Validator] rework the usage of `'*'` for the `protocols` option following #21398, related to symfony/symfony#61826 Commits ------- 83a9025 rework the usage of '*' for the protocols option
2 parents ff25fb4 + 83a9025 commit 057466d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

reference/constraints/Url.rst

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Parameter Description
165165
``protocols``
166166
~~~~~~~~~~~~~
167167

168-
**type**: ``array`` **default**: ``['http', 'https']``
168+
**type**: ``array|string`` **default**: ``['http', 'https']``
169169

170170
The protocols considered to be valid for the URL. For example, if you also consider
171171
the ``ftp://`` type URLs to be valid, redefine the ``protocols`` array, listing
@@ -237,20 +237,15 @@ the ``ftp://`` type URLs to be valid, redefine the ``protocols`` array, listing
237237
}
238238
}
239239
240-
The value of this option can also be an asterisk (``*``) to allow all protocols
241-
or a regular expression::
240+
The value of this option can also be an asterisk (``*``) to allow all protocols::
242241

243242
// allows all protocols whose names are RFC 3986 compliant
244243
// (e.g. 'https://', 'git+ssh://', 'file://', 'custom://')
245-
protocols: ['*']
246-
247-
// regular expressions are also valid
248-
protocols: ['https?', 'custom.*', 'my-app-.*']
244+
protocols: '*'
249245

250246
.. versionadded:: 7.4
251247

252-
Support for ``*`` and regular expressions in the ``protocols`` option was
253-
introduced in Symfony 7.4.
248+
Support for ``*`` in the ``protocols`` option was introduced in Symfony 7.4.
254249

255250
``relativeProtocol``
256251
~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)