Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 2674) +++ t3lib/class.t3lib_div.php (working copy) @@ -2853,23 +2853,35 @@ function view_array($array_in) { if (is_array($array_in)) { $result=''; - if (!count($array_in)) {$result.= '';} - while (list($key,$val)=each($array_in)) { - $result.= ''; + } else { + foreach ($array_in as $key => $val) { + $result.= ''; } - $result.= ''; + $result.= '
'.htmlspecialchars("EMPTY!").'
'.htmlspecialchars((string)$key).''; - if (is_array($array_in[$key])) { - $result.=t3lib_div::view_array($array_in[$key]); - } elseif (is_object($array_in[$key])) { - $result.= '[Object '.get_class($array_in[$key]).']'; - } else { - $result.= ''.nl2br(htmlspecialchars((string)$val)).'
'; + if (count($array_in) == 0) { + $result.= '
EMPTY!
'.htmlspecialchars((string)$key).''; + if (is_array($val)) { + $result.=t3lib_div::view_array($val); + } elseif (is_object($val)) { + $string = get_class($val); + if (method_exists($val, '__toString')) { + $string .= ': '.(string)$val; + } + $result .= ''.nl2br(htmlspecialchars($string)).'
'; + } else { + if (gettype($val) == 'object') { + $string = 'Unknown object'; + } else { + $string = (string)$val; + } + $result.= ''.nl2br(htmlspecialchars($string)).'
'; + } + $result.= '
'; } - $result.= ''; } else { $result = ' - +
'.nl2br(htmlspecialchars((string)$array_in)).'
'.nl2br(htmlspecialchars((string)$array_in)).'
'; // Output it as a string. }