fix parsing unknown perfdata value

fixes #700
This commit is contained in:
Tobias Tiederle 2023-01-17 11:23:51 +00:00 committed by Johannes Meyer
parent 0d96994d54
commit ef16387ca0

View file

@ -426,13 +426,17 @@ class PerfData
$parts = explode(';', $this->perfdataValue);
$matches = array();
if (preg_match('@^(-?(?:\d+)?(?:\.\d+)?)([a-zA-Z%°]{1,3})$@u', $parts[0], $matches)) {
if (preg_match('@^(U|-?(?:\d+)?(?:\.\d+)?)([a-zA-TV-Z%°]{1,3})$@u', $parts[0], $matches)) {
$this->unit = $matches[2];
$this->value = $matches[1];
} else {
$this->value = $parts[0];
}
if (! is_numeric($this->value)) {
$this->value = null;
}
switch (count($parts)) {
/* @noinspection PhpMissingBreakStatementInspection */
case 5: