From 1229eae0bf5e9231452d682bf979210fcfc74a28 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 23 Oct 2013 15:26:51 +0200 Subject: [PATCH] Monitoring/Perfdata: Fix throwing an exception when perfdata is a number with an exponential base --- modules/monitoring/library/Monitoring/Plugin/Perfdata.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php index c2f02187d..146c6a5e0 100644 --- a/modules/monitoring/library/Monitoring/Plugin/Perfdata.php +++ b/modules/monitoring/library/Monitoring/Plugin/Perfdata.php @@ -134,7 +134,9 @@ class Perfdata $unit = null; if (! preg_match('~^(\-?[\d+\.]+(?:E\-?\d+)?)([^\d]+)?$~', $this->val, $m)) { - throw new \Exception('Got invalid perfdata: ' . $perfdata); + return $perfdata; + // Numbers with an exponential base will be rendered invalid using the regex above +// throw new \Exception('Got invalid perfdata: ' . $perfdata); } $this->val = $m[1]; if (isset($m[2])) {