Skip to content

Commit

Permalink
MDL-72029 Lesson: Prevent arbitrary file read when importing lesson q…
Browse files Browse the repository at this point in the history
…uestions in blackboard format
  • Loading branch information
HuongNV13 authored and Jenkins committed Jul 6, 2022
1 parent d585f90 commit 3cafb30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion question/format/blackboard_six/format.php
Expand Up @@ -152,7 +152,8 @@ public function readdata($filename) {
}
if ($examfile->getAttribute('type') == 'assessment/x-bb-pool') {
if ($examfile->getAttribute('baseurl')) {
$fileobj->filebase = $this->tempdir. '/' . $examfile->getAttribute('baseurl');
$fileobj->filebase = clean_param($this->tempdir . '/'
. $examfile->getAttribute('baseurl'), PARAM_SAFEPATH);
}
if ($content = $this->get_filecontent($examfile->getAttribute('file'))) {
$fileobj->filetype = self::FILETYPE_POOL;
Expand Down

0 comments on commit 3cafb30

Please sign in to comment.