Added proper check for $CFG->filteruploadedfiles, so that text/plain files

are not converted to text/html if this is 'off'
See discussion: http://moodle.org/mod/forum/discuss.php?d=40177
This commit is contained in:
thepurpleblob
2006-02-21 10:43:23 +00:00
parent 88118bb173
commit 2f9bd37cc3
+1 -1
View File
@@ -263,7 +263,7 @@ function send_file($path, $filename, $lifetime=86400 , $filter=false, $pathisstr
@header('Content-Type: text/html');
while (@ob_end_flush()); //flush the buffers - save memory and disable sid rewrite
echo $output;
} else if ($mimetype == 'text/plain') {
} else if (($mimetype == 'text/plain') and ($CFG->filteruploadedfiles==1)) {
$options->newlines = false;
$options->noclean = true;
$text = htmlentities($pathisstring ? $path : implode('', file($path)));