mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
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:
parent
177d4abf11
commit
22afe6d699
1 changed files with 8 additions and 0 deletions
|
@ -64,6 +64,14 @@
|
||||||
// ensure the files area exists for this course
|
// ensure the files area exists for this course
|
||||||
make_upload_directory( "$course->id" );
|
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
|
/// Header
|
||||||
if (isset($SESSION->modform->instance) and $quiz = get_record('quiz', 'id', $SESSION->modform->instance)) {
|
if (isset($SESSION->modform->instance) and $quiz = get_record('quiz', 'id', $SESSION->modform->instance)) {
|
||||||
$strupdatemodule = has_capability('moodle/course:manageactivities', $context)
|
$strupdatemodule = has_capability('moodle/course:manageactivities', $context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue