From 58c2a64a17d6d49e078709db3196733250144228 Mon Sep 17 00:00:00 2001 From: Andrew Hancox Date: Fri, 25 Sep 2020 15:46:04 +0100 Subject: [PATCH] Fix deprecated function calls --- filter.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/filter.php b/filter.php index 10fcb1d..b701af4 100644 --- a/filter.php +++ b/filter.php @@ -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; } } @@ -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; } }