From 2f9bd37cc3744ffa5763cdee4aa02732eaaf9cb2 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Tue, 21 Feb 2006 10:43:23 +0000 Subject: [PATCH] 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 --- lib/filelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/filelib.php b/lib/filelib.php index a7fd1ef7a1d..d4800b685a6 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -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)));