Skip to content

[Validator] Add note to version option in Cidr constraint #20550

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
Jan 9, 2025
Merged
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
6 changes: 6 additions & 0 deletions reference/constraints/Cidr.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ Parameter Description
This determines exactly *how* the CIDR notation is validated and can take one
of :ref:`IP version ranges <reference-constraint-ip-version>`.

.. note::

IP range (``*_private``, ``*_reserved``) is only validating against IP, but not the whole
netmask. You need to set the ``{{ min }}`` value for the netmask to harden the validation a bit.
For example, ``9.0.0.0/6`` results to be ``*_public``, but also uses ``10.0.0.0/8`` range (``*_private``).

.. versionadded:: 7.1

The support of all IP version ranges was introduced in Symfony 7.1.
Expand Down
Loading