Skip to content
Browse files

CourseID is now mandatory on file.php

  • Loading branch information...
1 parent b2e0d6b commit b988c6284430cb5b153e22f5631982cf7f93f852 moodler committed Sep 7, 2004
Showing with 3 additions and 3 deletions.
  1. +3 −3 file.php
View
6 file.php
@@ -32,16 +32,16 @@
$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);
} else if ($CFG->forcelogin) {
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 '?'

0 comments on commit b988c62

Please sign in to comment.
Something went wrong with that request. Please try again.