MDL-18910 full support for module intro editor with embedded images
This commit is contained in:
+5
-1
@@ -191,7 +191,11 @@ function file_rewrite_pluginfile_urls($text, $file, $contextid, $filearea, $item
|
||||
$file = $file . '?file=';
|
||||
}
|
||||
|
||||
$baseurl = "$CFG->wwwroot/$file/$contextid/$filearea/$itemid/";
|
||||
$baseurl = "$CFG->wwwroot/$file/$contextid/$filearea/";
|
||||
|
||||
if ($itemid !== null) {
|
||||
$baseurl .= "$itemid/";
|
||||
}
|
||||
|
||||
if ($forcehttps) {
|
||||
$baseurl = str_replace('http://', 'https://', $baseurl);
|
||||
|
||||
+1
-1
@@ -1563,7 +1563,7 @@ function format_module_intro($module, $activity, $cmid, $filter=true) {
|
||||
require_once("$CFG->libdir/filelib.php");
|
||||
$options = (object)array('noclean'=>true, 'para'=>false, 'filter'=>false);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cmid);
|
||||
$intro = file_rewrite_pluginfile_urls($activity->intro, 'pluginfile.php', $context->id, $module.'_intro', 0);
|
||||
$intro = file_rewrite_pluginfile_urls($activity->intro, 'pluginfile.php', $context->id, $module.'_intro', null);
|
||||
return trim(format_text($intro, $activity->introformat, $options));
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,6 @@
|
||||
send_file_not_found();
|
||||
}
|
||||
// all users may access it
|
||||
$itemid = (int)array_shift($args);
|
||||
$relativepath = '/'.implode('/', $args);
|
||||
$fullpath = $context->id.$filearea.'0'.$relativepath;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user