From: robert Date: Fri, 20 May 2005 14:03:14 +0000 (+0000) Subject: apply converting non-numeric values to 'U' after converting 'L' so that 'L' can retur... X-Git-Url: https://git-public.kairo.at/?p=php-utility-classes.git;a=commitdiff_plain;h=eb12543d81760361058d1f92d2002c5c97c2fe5b;hp=31cb3fc44710f4ba3ca6de3ec119183e2e38e1a2 apply converting non-numeric values to 'U' after converting 'L' so that 'L' can return null and we convert it correctly to 'U' --- 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);