Monitoring/Perfdata: Fix throwing an exception when perfdata is a number with an exponential base

This commit is contained in:
Eric Lippmann 2013-10-23 15:26:51 +02:00
parent 8269d1542e
commit 1229eae0bf
1 changed files with 3 additions and 1 deletions

View File

@ -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])) {