diff --git a/olap.php b/olap.php index be5d458..c4df97c 100644 --- a/olap.php +++ b/olap.php @@ -330,6 +330,8 @@ class OLAP $tdhead = self::recurse_head($bytype['td'], $tdkeys); $trhead = self::recurse_head($bytype['tr'], $data); $cells = self::recurse_cells($fields, $data, $tdkeys); + if (!is_array($cells)) + $cells = array(array($cells)); $rows = array(); foreach ($tdhead as $i => &$v) { @@ -598,6 +600,11 @@ class OLAP $value = preg_replace('/\.0+$|(\.\d*?)0+$/', '\1', $value); return $value; } + elseif (($proc = self::$current_src['fielddescs'][$field]['format_func']) && + is_callable($proc)) + { + return $proc($value, self::$is_html_format); + } $fn = self::$is_html_format ? 'htmlspecialchars' : 'addslashes'; return $fn($value); }