From ddde4b447cf795939f27424920940c0b4b626e0e Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 27 Apr 2016 10:26:49 +0200 Subject: [PATCH] ThresholdRange: trim() raw ranges refs #8194 --- .../monitoring/library/Monitoring/Plugin/ThresholdRange.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php b/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php index 9f5040937..6acfa344c 100644 --- a/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php +++ b/modules/monitoring/library/Monitoring/Plugin/ThresholdRange.php @@ -40,6 +40,7 @@ class ThresholdRange { $range = new static(); + $rawRange = ltrim($rawRange); if (strpos($rawRange, '@') === 0) { $range->setInverted(true); $rawRange = substr($rawRange, 1); @@ -47,9 +48,11 @@ class ThresholdRange if (strpos($rawRange, ':') === false) { $min = 0.0; - $max = floatval($rawRange); + $max = trim(floatval($rawRange)); } else { list($min, $max) = explode(':', $rawRange, 2); + $min = trim($min); + $max = trim($max); switch ($min) { case '':