8000 fix compatibility with PHP < 8.2.4 · symfony/symfony@2d713ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d713ea

Browse files
committed
fix compatibility with PHP < 8.2.4
1 parent 49f4c44 commit 2d713ea

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/Symfony/Component/Validator/Constraints/NoSuspiciousCharactersValidator.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,17 @@ public function validate(mixed $value, Constraint $constraint): void
9999
}
100100

101101
foreach (self::CHECK_ERROR as $check => $error) {
102-
if (!($errorCode & $check)) {
102+
if (\PHP_VERSION_ID < 80204) {
103+
if (!($checks & $check)) {
104+
continue;
105+
}
106+
107+
$checker->setChecks($check);
108+
109+
if (!$checker->isSuspicious($value)) {
110+
continue;
111+
}
112+
} elseif (!($errorCode & $check)) {
103113
continue;
104114
}
105115

0 commit comments

Comments
 (0)
0