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