Commit fe017623 authored by Dries's avatar Dries
Browse files

- Fixed bug with checking for .txt files.

parent f8b90f62
......@@ -155,7 +155,7 @@ function file_check_upload($source) {
else {
$file->filemime = $_FILES["edit"]["type"][$source];
}
if (((substr($file->filemime, 0, 5) == 'text/' || strpos($file->filemime, 'javascript')) && (substr($file->filepath, -4) != '.txt')) || preg_match('/\.(php|pl|py|cgi|asp)$/i', $file->filename)) {
if (((substr($file->filemime, 0, 5) == 'text/' || strpos($file->filemime, 'javascript')) && (substr($file->filename, -4) != '.txt')) || preg_match('/\.(php|pl|py|cgi|asp)$/i', $file->filename)) {
$file->filemime = 'text/plain';
rename($file->filepath, $file->filepath .'.txt');
$file->filepath .= '.txt';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment