Skip to content

Commit

Permalink
MDL-9443 core_files: Also filter .xhtml resources.
Browse files Browse the repository at this point in the history
Change the filters to treat .xhtml files the same as .html,
so they are filtered by both "All files" and "HTML files only".
  • Loading branch information
David Balch committed Nov 19, 2014
1 parent c106341 commit 112aed6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/filelib.php
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mod/resource/lib.php
Expand Up @@ -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 {
Expand Down

0 comments on commit 112aed6

Please sign in to comment.