mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
PerfDataFormat: Ensure not to use string values when formatting perfdata
This commit is contained in:
parent
9d962a239a
commit
c5d5f1dfd3
1 changed files with 2 additions and 0 deletions
|
|
@ -117,6 +117,7 @@ class PerfDataFormat
|
|||
|
||||
public static function seconds($value): string
|
||||
{
|
||||
$value = (float) $value;
|
||||
$absValue = abs($value);
|
||||
|
||||
if ($absValue < 60) {
|
||||
|
|
@ -133,6 +134,7 @@ class PerfDataFormat
|
|||
protected static function formatForUnits($value, array &$units, int $base): string
|
||||
{
|
||||
$sign = '';
|
||||
$value = (float) $value;
|
||||
if ($value < 0) {
|
||||
$value = abs($value);
|
||||
$sign = '-';
|
||||
|
|
|
|||
Loading…
Reference in a new issue