From 79c9a8af9bee2f86002b0d8598b8695065f3256f Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Thu, 17 Sep 2015 12:52:09 +0200 Subject: [PATCH] lib: Fix Number::isValid(), again :) --- library/Icinga/Web/Form/Element/Number.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Icinga/Web/Form/Element/Number.php b/library/Icinga/Web/Form/Element/Number.php index 31bec6433..f7fa5292a 100644 --- a/library/Icinga/Web/Form/Element/Number.php +++ b/library/Icinga/Web/Form/Element/Number.php @@ -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; }