8000 [Security][Validator] do not validate empty values · symfony/symfony@010c61a · GitHub
[go: up one dir, main page]

Skip to content

Commit 010c61a

Browse files
committed
[Security][Validator] do not validate empty values
1 parent 7acc345 commit 010c61a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/Security/Core/Validator/Constraints/UserPasswordValidator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ public function validate($password, Constraint $constraint)
3939
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword');
4040
}
4141

42+
if (null === $password || '' === $password) {
43+
return;
44+
}
45+
4246
$user = $this->tokenStorage->getToken()->getUser();
4347

4448
if (!$user instanceof UserInterface) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function validate($value, Constraint $constraint)
4848
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Url');
4949
}
5050

51-
if (null === $value) {
51+
if (null === $value || '' === $value) {
5252
return;
5353
}
5454

0 commit comments

Comments
 (0)
0