X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=calendar.php;h=d9a7d29880b01c3d94be89f22768c4b30a92eed0;hb=130669e105c06dbfa3272ae9a2c41d5f11003a80;hp=78fc206af7d7ee2878bef1141c61273e6a5cd60a;hpb=b063dc432f05059d76aa02b08fe94c705ef66868;p=wfpl.git diff --git a/calendar.php b/calendar.php index 78fc206..d9a7d29 100644 --- a/calendar.php +++ b/calendar.php @@ -49,9 +49,16 @@ function calendar_day($kind, &$template) { $template->sub('day'); } -function calendar($year, $month, $events = 0, &$template = 0) { - if($template == 0) { - $template = $GLOBALS['wfpl_template']; +# php4 is broken, in that you cannot set a default value for a parameter that +# is passed by reference. So, this is set up to use the following screwy +# syntax: +# +# calendar('2006', '12', $events, ref($my_template)) +function calendar($year, $month, $events = 0, $template = 0) { + if($template === 0) { + $template = &$GLOBALS['wfpl_template']; + } else { + $template = &$template->ref; } if(strlen($year) == 2) {