From eb12543d81760361058d1f92d2002c5c97c2fe5b Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 20 May 2005 14:03:14 +0000 Subject: [PATCH] apply converting non-numeric values to 'U' after converting 'L' so that 'L' can return null and we convert it correctly to 'U' --- include/classes/rrdstat.php-class | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/classes/rrdstat.php-class b/include/classes/rrdstat.php-class index 833820a..5c64af1 100644 --- a/include/classes/rrdstat.php-class +++ b/include/classes/rrdstat.php-class @@ -297,8 +297,6 @@ class rrdstat { if (strlen($ret)) { $upvals = explode("\n", $ret); } ob_end_clean(); } - $walkfunc = create_function('&$val,$key', '$val = is_numeric(trim($val))?trim($val):((trim($val)=="L")?"L":"U");'); - array_walk($upvals, $walkfunc); } else { foreach ($this->rrd_fields as $ds) { @@ -332,7 +330,6 @@ class rrdstat { } } else { $val = null; } - $upvals[] = is_null($val)?'U':$val; } } if (in_array('L', $upvals)) { @@ -344,6 +341,8 @@ class rrdstat { $upvals[$akey] = $lastvals[$rowids[$akey]]; } } + $walkfunc = create_function('&$val,$key', '$val = is_numeric(trim($val))?trim($val):"U";'); + array_walk($upvals, $walkfunc); $return = null; if (count($upvals)) { $update_cmd = 'rrdtool update '.$this->rrd_file.' N:'.implode(':', $upvals); -- 2.43.0