From aad7baa5c40b0a29ef48f57f689149cbe90e1429 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Tue, 15 Dec 2015 17:32:45 +0100 Subject: [PATCH] Perfdata::getPercentage(): prevent division by integer 0 fixes #10331 --- modules/monitoring/library/Monitoring/Plugin/Perfdata.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php index 34a6cb30f..617546788 100644 --- a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php +++ b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php @@ -212,7 +212,7 @@ class Perfdata if ($this->maxValue !== null) { $minValue = $this->minValue !== null ? $this->minValue : 0; - if ($this->maxValue - $minValue === 0.0) { + if ((float) ($this->maxValue - $minValue) === 0.0) { return null; }