From 2b469d2b56c288f8fc18d004ed85e55832739e6f Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Tue, 29 Nov 2005 03:51:50 +0000 Subject: patches to template.php to handle empty master array without warning on bad foreach - suggested from the bbs by andrew. See http://phpicalendar.net/forums/viewtopic.php?t=292 --- functions/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'functions/template.php') diff --git a/functions/template.php b/functions/template.php index e18b101..260d057 100644 --- a/functions/template.php +++ b/functions/template.php @@ -269,7 +269,7 @@ class Page { $replace = $loop_begin; $colspan = 'colspan="'.$nbrGridCols[$get_date].'"'; $replace = str_replace('{COLSPAN}', $colspan, $replace); - if (is_array($master_array[$get_date]['-1'])) { + if (is_array($master_array[$get_date]['-1']) && !empty($master_array[$get_date]['-1']) ) { foreach ($master_array[$get_date]['-1'] as $uid => $allday) { $event_calno = $allday['calnumber']; $event_calno = (($event_calno - 1) % $unique_colors) + 1; -- cgit v1.2.3