Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a801daa

Browse filesBrowse files
sidzxabbuh
andauthored
Do not depend on mbstring
Co-authored-by: Christian Flothmann <christian.flothmann@gmail.com>
1 parent f21b03b commit a801daa
Copy full SHA for a801daa

File tree

1 file changed

+1
-1
lines changed
Filter options

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/Validator/Constraints/WordCountValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/WordCountValidator.php
+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function validate(mixed $value, Constraint $constraint): void
4444
$words = iterator_to_array($iterator->getPartsIterator());
4545

4646
// erase "blank words" and don't count them as words
47-
$wordsCount = \count(array_filter(array_map(trim(...), $words), 'mb_strlen'));
47+
$wordsCount = \count(array_filter(array_map(trim(...), $words), fn ($word) => '' !== $word));
4848

4949
if (null !== $constraint->min && $wordsCount < $constraint->min) {
5050
$this->context->buildViolation($constraint->minMessage)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.