From df17569a0443ed474051583f1db0d11f5fbdedae Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 22 Apr 2010 22:33:29 +0000 Subject: - Patch #722978 by Alan D., duellj: invalid header count for empty message in theme_table(). --- includes/theme.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/theme.inc b/includes/theme.inc index 6bfb95c40..fb911426a 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1680,7 +1680,16 @@ function theme_table($variables) { // Add the 'empty' row message if available. if (!count($rows) && $empty) { - $rows[] = array(array('data' => $empty, 'colspan' => count($header), 'class' => array('empty', 'message'))); + $header_count = 0; + foreach ($header as $header_cell) { + if (is_array($header_cell)) { + $header_count += isset($header_cell['colspan']) ? $header_cell['colspan'] : 1; + } + else { + $header_count++; + } + } + $rows[] = array(array('data' => $empty, 'colspan' => $header_count, 'class' => array('empty', 'message'))); } // Format the table header: -- cgit v1.2.3