Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c87580

Browse files
author
Alexander Miehe
committed
Fix #12315
* change string check
1 parent f9d6bc0 commit 1c87580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function validate($value, Constraint $constraint)
4747
$variables['value'] = $value;
4848
$variables['this'] = $this->context->getObject();
4949

50-
if (strlen($constraint->dataPath) > 0) {
50+
if (null !== $constraint->dataPath && '' !== $constraint->dataPath) {
5151
$variables['this'] = $this->getPropertyAccessor()->getValue($this->context, $constraint->dataPath);
5252
}
5353

0 commit comments

Comments
 (0)