]> git.mjollnir.org Git - moodle.git/commitdiff
Merged from stable
authormoodler <moodler>
Tue, 7 Sep 2004 14:13:19 +0000 (14:13 +0000)
committermoodler <moodler>
Tue, 7 Sep 2004 14:13:19 +0000 (14:13 +0000)
file.php

index b25e6cf301e1f1cbc4c7e102befd1cfa9d329bfe..9443edb52d30cc44dfaa12f2df61b29fc40f83cd 100644 (file)
--- a/file.php
+++ b/file.php
@@ -32,7 +32,9 @@
 
     $courseid = (integer)$args[0];
 
-    $course = get_record("course", "id", $courseid);
+    if (!$course = get_record("course", "id", $courseid)) {  // Course ID must be specified
+        error("Invalid course ID");
+    }
 
     if ($course->category) {
         require_login($courseid);
@@ -40,8 +42,6 @@
         require_login();
     }
 
-    // it's OK to get here if no course was specified
-
     $pathname = "$CFG->dataroot$pathinfo";
     if ($pathargs = explode("?",$pathname)) {
         $pathname = $pathargs[0];            // Only keep what's before the '?'