MDL-9123:

No check was made of the validity of the category id read from the form.
So it could theoretically have been spoofed.
This commit is contained in:
thepurpleblob 2007-04-11 11:00:26 +00:00
parent 177d4abf11
commit 22afe6d699

View file

@ -64,6 +64,14 @@
// ensure the files area exists for this course
make_upload_directory( "$course->id" );
// check category is valid
if (!empty($categoryid)) {
$validcats = question_category_options( $course->id, true, false );
if (!array_key_exists( $categoryid, $validcats)) {
print_error( "Category id ($categoryid) is not permitted." );
}
}
/// Header
if (isset($SESSION->modform->instance) and $quiz = get_record('quiz', 'id', $SESSION->modform->instance)) {
$strupdatemodule = has_capability('moodle/course:manageactivities', $context)