summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/file.inc2
1 files changed, 1 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index 6ab1d77f8..9649a45ab 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -228,7 +228,7 @@ function file_check_upload($source = 'upload') {
$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';