MDL-9123:

Check that the selected category is allowed.
This commit is contained in:
thepurpleblob
2007-07-26 10:54:53 +00:00
parent 5008d3951f
commit 88f3ed390f
+6 -2
View File
@@ -73,10 +73,14 @@
}
}
if (!$courseid) { // need to get the course from the chosen category
$courseid = $category->course;
// check category is valid (against THIS courseid, before we change it)
$validcats = question_category_options( $courseid, true, true );
if (!array_key_exists( $categoryid, $validcats )) {
print_error( 'invalidcategory', 'quiz' );
}
$courseid = $category->course;
if (!$course = get_record("course", "id", $courseid)) {
error("Invalid course!");
}