Skip to content

Commit 93a70fe

Browse files
authored
Merge pull request #178 from vitaliytv/patch-2
Fix counting of non-countable var for PHP 7.2
2 parents f60c227 + d2a1886 commit 93a70fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/form/sfFormField.class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ public function getError()
324324
*/
325325
public function hasError()
326326
{
327-
return null !== $this->error && count($this->error);
327+
if ($this->error instanceof sfValidatorErrorSchema) {
328+
return $this->error->count() > 0;
329+
}
330+
331+
return $this->error !== null;
328332
}
329333
}

0 commit comments

Comments
 (0)