--- includes/file.inc	2006/08/18 12:16:57  1.82
+++ includes/file.inc	2006/08/29 22:43:58
@@ -228,7 +228,7 @@ function file_check_upload($source = 'up
     $file->filemime = $_FILES["edit"]["type"][$source];
 
     // Rename potentially executable files, to help prevent exploits.
-    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)) {
+    if (preg_match('/\.(php|pl|py|cgi|asp|js)$/i', $file->filename) && (substr($file->filename, -4) != '.txt')) {
       $file->filemime = 'text/plain';
       $file->filepath .= '.txt';
       $file->filename .= '.txt';
