From 83a9025f94381d1ca5a8749a6000f5c2ff33307c Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 24 Sep 2025 12:12:41 +0200 Subject: [PATCH] rework the usage of '*' for the protocols option --- reference/constraints/Url.rst | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/reference/constraints/Url.rst b/reference/constraints/Url.rst index 5a9b4cd0da8..eccee53e05a 100644 --- a/reference/constraints/Url.rst +++ b/reference/constraints/Url.rst @@ -165,7 +165,7 @@ Parameter Description ``protocols`` ~~~~~~~~~~~~~ -**type**: ``array`` **default**: ``['http', 'https']`` +**type**: ``array|string`` **default**: ``['http', 'https']`` The protocols considered to be valid for the URL. For example, if you also consider 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 } } -The value of this option can also be an asterisk (``*``) to allow all protocols -or a regular expression:: +The value of this option can also be an asterisk (``*``) to allow all protocols:: // allows all protocols whose names are RFC 3986 compliant // (e.g. 'https://', 'git+ssh://', 'file://', 'custom://') - protocols: ['*'] - - // regular expressions are also valid - protocols: ['https?', 'custom.*', 'my-app-.*'] + protocols: '*' .. versionadded:: 7.4 - Support for ``*`` and regular expressions in the ``protocols`` option was - introduced in Symfony 7.4. + Support for ``*`` in the ``protocols`` option was introduced in Symfony 7.4. ``relativeProtocol`` ~~~~~~~~~~~~~~~~~~~~