diff --git a/src/Symfony/Component/Validator/Constraints/NoSuspiciousCharactersValidator.php b/src/Symfony/Component/Validator/Constraints/NoSuspiciousCharactersValidator.php index d82a62d57dd60..0b7a78ef92e40 100644 --- a/src/Symfony/Component/Validator/Constraints/NoSuspiciousCharactersValidator.php +++ b/src/Symfony/Component/Validator/Constraints/NoSuspiciousCharactersValidator.php @@ -99,7 +99,17 @@ public function validate(mixed $value, Constraint $constraint): void } foreach (self::CHECK_ERROR as $check => $error) { - if (!($errorCode & $check)) { + if (\PHP_VERSION_ID < 80204) { + if (!($checks & $check)) { + continue; + } + + $checker->setChecks($check); + + if (!$checker->isSuspicious($value)) { + continue; + } + } elseif (!($errorCode & $check)) { continue; }