From 360ab25d22eb12b7065a13a7f3abc7cf71e65e9d Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Thu, 2 Mar 2006 08:46:50 +0000
Subject: [PATCH] - Patch #43220 by chx: removed the mime type magic until a
 better fix comes along.

---
 includes/file.inc | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/includes/file.inc b/includes/file.inc
index e9529b3899f0..f8d7b91e6e5c 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -146,16 +146,8 @@ function file_check_upload($source) {
     $file = new StdClass();
     $file->filename = trim(basename($_FILES["edit"]["name"][$source]), '.');
     $file->filepath = $_FILES["edit"]["tmp_name"][$source];
+    $file->filemime = $_FILES["edit"]["type"][$source];
 
-    if (function_exists('mime_content_type')) {
-      $file->filemime = mime_content_type($file->filepath);
-      if ($file->filemime != $_FILES["edit"]["type"][$source]) {
-        watchdog('file', t('For %file the system thinks its MIME type is %detected while the user has given %given for MIME type', array('%file' => theme('placeholder', $file->filepath), '%detected' => theme('placeholder', $file->filemime), '%given' => theme('placeholder', $_FILES['edit']['type'][$source]))));
-      }
-    }
-    else {
-      $file->filemime = $_FILES["edit"]["type"][$source];
-    }
     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');
-- 
GitLab