Skip to content

Commit 69a1ddd

Browse files
MathieuMatTheCat
authored andcommitted
1 parent fa853fe commit 69a1ddd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

reference/constraints.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Validation Constraints Reference
7878
constraints/Valid
7979
constraints/Traverse
8080
constraints/CssColor
81+
constraints/NoSuspiciousCharacters
8182

8283
The Validator is designed to validate objects against *constraints*.
8384
In real life, a constraint could be: "The cake must not be burned". In

reference/constraints/NoSuspiciousCharacters.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NoSuspiciousCharacters
1616
"symfony.com" and "ѕymfony.com" look similar, but the latter actually starts with a
1717
`cyrillic small letter dze`_. It could make a user think they'll navigate to Symfony's
1818
website, whereas it would be somewhere else.
19-
This is a kind of `spoofing attack`_ (called "IDN homograph attack"): it tries to
19+
This is a kind of `spoofing attack`_ (called "IDN homograph attack"). It tries to
2020
identify something as something else to exploit the resulting confusion.
2121
This is why it is recommended to check user-submitted, public-facing identifiers for
2222
suspicious characters in order to prevent such attacks.
@@ -104,8 +104,8 @@ Options
104104
This option is a bitmask of the checks you want to perform on the string:
105105

106106
* ``NoSuspiciousCharacters::CHECK_INVISIBLE`` checks for the presence of invisible characters such as zero-width spaces, or character sequences that are likely not to display, such as multiple occurrences of the same non-spacing mark.
107-
* ``NoSuspiciousCharacters::CHECK_MIXED_NUMBERS`` (since ICU 58) checks for numbers from different numbering systems.
108-
* ``NoSuspiciousCharacters::CHECK_HIDDEN_OVERLAY`` (since ICU 62) checks for combining characters hidden in their preceding one.
107+
* ``NoSuspiciousCharacters::CHECK_MIXED_NUMBERS`` (usable with ICU 58 or higher) checks for numbers from different numbering systems.
108+
* ``NoSuspiciousCharacters::CHECK_HIDDEN_OVERLAY`` (usable with ICU 62 or higher) checks for combining characters hidden in their preceding one.
109109

110110
You can also configure additional requirements using :ref:`locales <locales>` and
111111
:ref:`restrictionLevel <restrictionlevel>`.
@@ -126,20 +126,20 @@ Passing an empty array, or configuring :ref:`restrictionLevel <restrictionlevel>
126126
``restrictionLevel``
127127
~~~~~~~~~~~~~~~~~~~~
128128

129-
**type**: ``integer`` **default**: ``NoSuspiciousCharacters::RESTRICTION_LEVEL_MODERATE`` on ICU >= 58, else ``NoSuspiciousCharacters::RESTRICTION_LEVEL_SINGLE_SCRIPT``
129+
**type**: ``integer`` **default**: ``NoSuspiciousCharacters::RESTRICTION_LEVEL_MODERATE`` on ICU >= 58, otherwise ``NoSuspiciousCharacters::RESTRICTION_LEVEL_SINGLE_SCRIPT``
130130

131131
Configures the set of acceptable characters for the validated string through a
132132
specified "level":
133133

134134
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_MINIMAL`` requires the string's characters to match :ref:`the configured locales <locales>`'.
135135
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_MODERATE`` also requires the string to be `covered`_ by Latin and any one other `Recommended`_ or `Limited Use`_ script, except Cyrillic, Greek, and Cherokee.
136-
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_HIGH`` (since ICU 58) also requires the string to be `covered`_ by any of the following sets of scripts:
136+
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_HIGH`` (usable with ICU 58 or higher) also requires the string to be `covered`_ by any of the following sets of scripts:
137137

138138
* Latin + Han + Bopomofo (or equivalently: Latn + Hanb)
139139
* Latin + Han + Hiragana + Katakana (or equivalently: Latn + Jpan)
140140
* Latin + Han + Hangul (or equivalently: Latn + Kore)
141141
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_SINGLE_SCRIPT`` also requires the string to be `single-script`_.
142-
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_ASCII`` (since ICU 58) also requires the string's characters to be in the ASCII range.
142+
* ``NoSuspiciousCharacters::RESTRICTION_LEVEL_ASCII`` (usable with ICU 58 or higher) also requires the string's characters to be in the ASCII range.
143143

144144
You can accept all characters by setting this option to
145145
``NoSuspiciousCharacters::RESTRICTION_LEVEL_NONE``.

0 commit comments

Comments
 (0)