Skip to content
Browse files

MDL-38261 Replace deprecated file_encode_url() in workshop renderer

  • Loading branch information...
1 parent 57c1c7e commit 4cd2b45548b06331f8564246edfa06e94f75acdb @mudrd8mz mudrd8mz committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 mod/workshop/renderer.php
View
8 mod/workshop/renderer.php
@@ -797,9 +797,11 @@ protected function helper_submission_attachments($submissionid, $format = 'html'
$filepath = $file->get_filepath();
$filename = $file->get_filename();
- $fileurl = file_encode_url($CFG->wwwroot . '/pluginfile.php',
- '/' . $ctx->id . '/mod_workshop/submission_attachment/' . $submissionid . $filepath . $filename, true);
- $embedurl = new moodle_url($fileurl, array('preview' => 'bigthumb'));
+ $fileurl = moodle_url::make_pluginfile_url($ctx->id, 'mod_workshop', 'submission_attachment',
+ $submissionid, $filepath, $filename, true);
+ $embedurl = moodle_url::make_pluginfile_url($ctx->id, 'mod_workshop', 'submission_attachment',
+ $submissionid, $filepath, $filename, false);
+ $embedurl = new moodle_url($embedurl, array('preview' => 'bigthumb'));
$type = $file->get_mimetype();
$image = $this->output->pix_icon(file_file_icon($file), get_mimetype_description($file), 'moodle', array('class' => 'icon'));

0 comments on commit 4cd2b45

Please sign in to comment.
Something went wrong with that request. Please try again.