From fe017623877aec5b2d48776f289ea27efad870f7 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 30 Nov 2005 19:28:18 +0000 Subject: - Fixed bug with checking for .txt files. --- includes/file.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/file.inc b/includes/file.inc index a1232f1e9..0f2bce694 100644 --- a/includes/file.inc +++ b/includes/file.inc @@ -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'; -- cgit v1.2.3