MDL-9443 core_files: Also filter .xhtml resources.

Change the filters to treat .xhtml files the same as .html,
so they are filtered by both "All files" and "HTML files only".
This commit is contained in:
David Balch
2014-11-19 14:14:50 +00:00
parent c106341098
commit 112aed6035
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -2320,7 +2320,7 @@ function send_file($path, $filename, $lifetime = null , $filter=0, $pathisstring
} else {
// Try to put the file through filters
if ($mimetype == 'text/html') {
if ($mimetype == 'text/html' || $mimetype == 'application/xhtml+xml') {
$options = new stdClass();
$options->noclean = true;
$options->nocache = true; // temporary workaround for MDL-5136
@@ -2494,7 +2494,7 @@ function send_stored_file($stored_file, $lifetime=null, $filter=0, $forcedownloa
readfile_accel($stored_file, $mimetype, !$dontdie);
} else { // Try to put the file through filters
if ($mimetype == 'text/html') {
if ($mimetype == 'text/html' || $mimetype == 'application/xhtml+xml') {
$options = new stdClass();
$options->noclean = true;
$options->nocache = true; // temporary workaround for MDL-5136
+1 -1
View File
@@ -383,7 +383,7 @@ function resource_pluginfile($course, $cm, $context, $filearea, $args, $forcedow
// should we apply filters?
$mimetype = $file->get_mimetype();
if ($mimetype === 'text/html' or $mimetype === 'text/plain') {
if ($mimetype === 'text/html' or $mimetype === 'text/plain' or $mimetype === 'application/xhtml+xml') {
$filter = $DB->get_field('resource', 'filterfiles', array('id'=>$cm->instance));
$CFG->embeddedsoforcelinktarget = true;
} else {