IcingaObject: cast interval properties to int

They might be strings when shipped from DB or older Baskets
This commit is contained in:
Thomas Gelf 2023-03-07 11:18:24 +01:00
parent 903f2c825f
commit d6bec9bfe1
1 changed files with 3 additions and 0 deletions

View File

@ -2878,6 +2878,9 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
}
}
}
if ($this->propertyIsInterval($k) && is_string($v) && ctype_digit($v)) {
$v = (int) $v;
}
// TODO: Do not ship null properties based on flag?
if (!$skipDefaults || $this->differsFromDefaultValue($k, $v)) {