Browse files

Fix for bug 1462:

Warnings removed.
  • Loading branch information...
1 parent 4520ce7 commit 7bd1677c72716fbfbe162832a4c99e04f7c73f72 defacer committed May 26, 2004
Showing with 12 additions and 12 deletions.
  1. +12 −12 calendar/lib.php
View
24 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) {

0 comments on commit 7bd1677

Please sign in to comment.