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:
+2
-2
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user