Skip to content

Commit f55f474

Browse files
committed
minor #11456 Update Length constraint description (mb_strlen) (guilliamxavier)
This PR was merged into the 3.4 branch. Discussion ---------- Update Length constraint description (mb_strlen) The current implementation ([3.4] and [4.2]) uses only `mb_strlen` (after `mb_check_encoding`). [3.4]: https://github.com/symfony/symfony/blob/3.4/src/Symfony/Component/Validator/Constraints/LengthValidator.php#L42-L44 [4.2]: https://github.com/symfony/symfony/blob/4.2/src/Symfony/Component/Validator/Constraints/LengthValidator.php#L43-L45 History: [years ago][1] the `grapheme_strlen` attempt was replaced with `iconv_strlen` (and `preg_replace`), [later on][2] the whole implementation (including plain `strlen`) was reduced to keep only `iconv_strlen`, and [finally][3] (but still years ago) `iconv_strlen` was replaced with `mb_check_encoding` + `mb_strlen`. [1]: symfony/symfony@915fcd8 [2]: symfony/symfony@303f05b#diff-467932f4ce8a7100a8e0184cf9463e6a [3]: symfony/symfony@27f5f81#diff-467932f4ce8a7100a8e0184cf9463e6a Commits ------- 03bd47f Update Length constraint description (mb_strlen)
2 parents b75912f + 03bd47f commit f55f474

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

reference/constraints/Length.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ charset
143143
**type**: ``string`` **default**: ``UTF-8``
144144

145145
The charset to be used when computing value's length. The
146-
:phpfunction:`grapheme_strlen` PHP function is used if available. If not,
147-
the :phpfunction:`mb_strlen` PHP function is used if available. If neither
148-
are available, the :phpfunction:`strlen` PHP function is used.
146+
:phpfunction:`mb_check_encoding` and :phpfunction:`mb_strlen`
147+
PHP functions are used.
149148

150149
minMessage
151150
~~~~~~~~~~

0 commit comments

Comments
 (0)