merged some fixes from Trunk to quieten warnings in CalDAV:

- r36515: query_list(). initialize return value to array(), to allways return an array
- r36542: skip the empty (NULL) row
This commit is contained in:
Ralf Becker 2011-11-06 09:49:53 +00:00
parent 80510b5412
commit bd616f8a34

View File

@ -1435,7 +1435,7 @@ class so_sql
} }
if (!is_array($value_col)) $value_col = array($value_col); if (!is_array($value_col)) $value_col = array($value_col);
$cols = array(); $cols = $ret = array();
foreach($value_col as $key => $col) foreach($value_col as $key => $col)
{ {
$cols[$key] = preg_match('/AS ([a-z_0-9]+)$/i',$col,$matches) ? $matches[1] : $col; $cols[$key] = preg_match('/AS ([a-z_0-9]+)$/i',$col,$matches) ? $matches[1] : $col;
@ -1466,7 +1466,7 @@ class so_sql
{ {
$data = $row[current($cols)]; $data = $row[current($cols)];
} }
$ret[$row[$key_col]] = $data; if ($data) $ret[$row[$key_col]] = $data;
} }
} }
return $cache[$cache_key] =& $ret; return $cache[$cache_key] =& $ret;