Merge branch 'MDL-36754-master' of git://github.com/andrewnicols/moodle
authorDavid Monllao <davidm@moodle.com>
Tue, 14 Aug 2018 08:18:55 +0000 (10:18 +0200)
committerDavid Monllao <davidm@moodle.com>
Tue, 14 Aug 2018 08:18:55 +0000 (10:18 +0200)
lib/filelib.php

index 01b360c..ded335b 100644 (file)
@@ -481,6 +481,7 @@ function file_rewrite_pluginfile_urls($text, $file, $contextid, $component, $fil
         $finalfile = basename($file);
         $tokenfile = "token{$finalfile}";
         $file = substr($file, 0, strlen($file) - strlen($finalfile)) . $tokenfile;
+        $baseurl = "{$CFG->wwwroot}/{$file}";
 
         if (!$CFG->slasharguments) {
             $baseurl .= "?token={$token}&file=";