From: moodler Date: Fri, 21 Mar 2003 04:49:29 +0000 (+0000) Subject: Small fix to avoid PHP warnings X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f8430195d9dfde014c8171666dff6f6bbbdd3657;p=moodle.git Small fix to avoid PHP warnings --- diff --git a/course/topics.php b/course/topics.php index a91cd48063..7f2970d737 100644 --- a/course/topics.php +++ b/course/topics.php @@ -146,7 +146,10 @@ echo ""; - if (! $thissection = $sections[$section]) { + if (!empty($sections[$section])) { + $thissection = $sections[$section]; + + } else { $thissection->course = $course->id; // Create a new section structure $thissection->section = $section; $thissection->summary = ""; diff --git a/course/weeks.php b/course/weeks.php index dbcfaf283d..b76b7b764e 100644 --- a/course/weeks.php +++ b/course/weeks.php @@ -147,7 +147,9 @@ echo ""; echo "

cellheading2\">$weekday - $endweekday

"; - if (! $thisweek = $sections[$week]) { + if (!empty($sections[$week])) { + $thisweek = $sections[$week]; + } else { $thisweek->course = $course->id; // Create a new week structure $thisweek->section = $week; $thisweek->summary = "";