lib: Fix Number::isValid(), again :)

This commit is contained in:
Eric Lippmann 2015-09-17 12:52:09 +02:00
parent ccfbc13a38
commit 79c9a8af9b
1 changed files with 1 additions and 1 deletions

View File

@ -134,7 +134,7 @@ class Number extends FormElement
{
$this->setValue($value);
$value = $this->getValue();
if ($this->isRequired() && ! is_numeric($value)) {
if ($value !== '' && ! is_numeric($value)) {
$this->addError(sprintf(t('\'%s\' is not a valid number'), $value));
return false;
}