Skip to content

Commit

Permalink
Make sure teachers can't upload videos into arbitrary series.
Browse files Browse the repository at this point in the history
By only accepting the series param if on $courseid==$SITE->id.
  • Loading branch information
justusdieckmann committed Mar 14, 2024
1 parent 02eaf59 commit 1ced42b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addvideo.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@
require_once($CFG->dirroot . '/repository/lib.php');

$courseid = required_param('courseid', PARAM_INT);
$series = optional_param('series', null, PARAM_ALPHANUMEXT);
if ($courseid == $SITE->id) {
$series = optional_param('series', null, PARAM_ALPHANUMEXT);
} else {
$series = null;
}
$ocinstanceid = optional_param('ocinstanceid', settings_api::get_default_ocinstance()->id, PARAM_INT);

$baseurlparams = [
Expand Down

0 comments on commit 1ced42b

Please sign in to comment.