apply converting non-numeric values to 'U' after converting 'L' so that 'L' can retur...
authorrobert <robert>
Fri, 20 May 2005 14:03:14 +0000 (14:03 +0000)
committerrobert <robert>
Fri, 20 May 2005 14:03:14 +0000 (14:03 +0000)
include/classes/rrdstat.php-class

index 833820a8e30bf3bee8e91d1bf0fd03cf0b2082dd..5c64af169d9836575b43780619418903b24a5fcf 100644 (file)
@@ -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);