mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
If the uploaded file is HTML, then put it through the filters
This commit is contained in:
parent
e359234d0f
commit
f05070115c
7
file.php
7
file.php
@ -49,7 +49,12 @@
|
||||
header("Content-disposition: inline; filename=$filename");
|
||||
header("Content-length: ".filesize($pathname));
|
||||
header("Content-type: $mimetype");
|
||||
readfile("$pathname");
|
||||
|
||||
if ($mimetype == "text/html") {
|
||||
echo format_text(implode('', file($pathname)), FORMAT_HTML); // Filter HTML files
|
||||
} else {
|
||||
readfile("$pathname");
|
||||
}
|
||||
} else {
|
||||
error("Sorry, but the file you are looking for was not found ($pathname)", "course/view.php?id=$courseid");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user