Skip to content

Commit

Permalink
Fix deprecated function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewhancox committed Sep 25, 2020
1 parent 1e4b56d commit 58c2a64
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -752,9 +752,9 @@ function ($matches) {
$coursefiles = $course->get_course_overviewfiles();
foreach ($coursefiles as $file) {
if ($isimage = $file->is_valid_image()) {
$imgurl = file_encode_url("/pluginfile.php", '/' . $file->get_contextid() . '/' . $file->get_component()
. '/' . $file->get_filearea() . $file->get_filepath() . $file->get_filename() , !$isimage);
$imgurl = new moodle_url($imgurl);
$imgurl = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(),
$file->get_filearea(), null, $file->get_filepath(),
$file->get_filename())->out(false);
break;
}
}
Expand Down Expand Up @@ -900,10 +900,9 @@ function ($matches) {
$imgurl = '';
foreach ($coursefiles as $file) {
if ($isimage = $file->is_valid_image()) {
$imgurl = file_encode_url("/pluginfile.php", '/' . $file->get_contextid() . '/'
. $file->get_component() . '/' . $file->get_filearea() . $file->get_filepath()
. $file->get_filename(), !$isimage);
$imgurl = new moodle_url($imgurl);
$imgurl = moodle_url::make_pluginfile_url($file->get_contextid(), $file->get_component(),
$file->get_filearea(), null, $file->get_filepath(),
$file->get_filename())->out(false);
break;
}
}
Expand Down

0 comments on commit 58c2a64

Please sign in to comment.