From 7bd1677c72716fbfbe162832a4c99e04f7c73f72 Mon Sep 17 00:00:00 2001 From: defacer Date: Wed, 26 May 2004 11:03:27 +0000 Subject: [PATCH] Fix for bug 1462: Warnings removed. --- calendar/lib.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/calendar/lib.php b/calendar/lib.php index d8e558fa7f..4d1170b2f9 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -120,12 +120,12 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y // will also set the $SESSION->cal_courses_shown variable to that one course. Otherwise, we 'd need to add extra // arguments to this function. - $courses = array_diff($courses, array(1)); - if(count($courses) == 1) { - $morehref = '&course='.reset($courses); - } - else { - $morehref = ''; + $morehref = ''; + if(!empty($courses)) { + $courses = array_diff($courses, array(1)); + if(count($courses) == 1) { + $morehref = '&course='.reset($courses); + } } // We want to have easy access by day, since the display is on a per-day basis. @@ -305,12 +305,12 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve // will also set the $SESSION->cal_courses_shown variable to that one course. Otherwise, we 'd need to add extra // arguments to this function. - $courses = array_diff($courses, array(1)); - if(count($courses) == 1) { - $morehref = '&course='.reset($courses); - } - else { - $morehref = ''; + $morehref = ''; + if(!empty($courses)) { + $courses = array_diff($courses, array(1)); + if(count($courses) == 1) { + $morehref = '&course='.reset($courses); + } } if($events !== false) { -- 2.39.5