]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8223 - added detection of wrong course id
authorskodak <skodak>
Fri, 19 Jan 2007 09:54:25 +0000 (09:54 +0000)
committerskodak <skodak>
Fri, 19 Jan 2007 09:54:25 +0000 (09:54 +0000)
lib/moodlelib.php

index 81f367ca08e2b0d565443c8ba4b7555c29935013..98c318eff5224a517b889de241fd4bb998a05620 100644 (file)
@@ -1587,7 +1587,9 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null) {
         if ($course->id == $courseorid) {
             $COURSE = clone($course);
         } else {
-            $COURSE = get_record('course', 'id', $courseorid);
+            if (!$COURSE = get_record('course', 'id', $courseorid)) {
+                error('Invalid course ID');
+            }
         }
     }