mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
lib: Fix Number::isValid()
- Calls $this->translate() - Always performs is_numeric check, even if the element is not required
This commit is contained in:
parent
947d5c6190
commit
e8c21868ff
@ -134,8 +134,8 @@ class Number extends FormElement
|
|||||||
{
|
{
|
||||||
$this->setValue($value);
|
$this->setValue($value);
|
||||||
$value = $this->getValue();
|
$value = $this->getValue();
|
||||||
if (! is_numeric($value)) {
|
if ($this->isRequired() && ! is_numeric($value)) {
|
||||||
$this->addError(sprintf($this->translate('\'%s\' is not a valid number'), $value));
|
$this->addError(sprintf(t('\'%s\' is not a valid number'), $value));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return parent::isValid($value, $context);
|
return parent::isValid($value, $context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user