Line 194:

  // Trust the browser...  ack!
  if (!$mime) {
    $mime = $file->filemime;
  }

Is there a specific reason why you're trusting the browser for file-type checking before the list of extensions?
I'm having an issue here, where m4a files (aac) aren't being correctly recognised as "audio/mp4", so I've added them to the list of known extension_mimes, and moved the browser-trust BELOW the mime checker.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

Title: Trust the browser? » Don't trust the browser and use file_get_mimetype()'s more complete database.
Version: 5.x-1.0 » 6.x-1.x-dev
Status: Active » Needs review
FileSize
5.44 KB

you're right it really isn't a good idea. i'm dropping it and using core's file_get_mimetype() function since it's got a more complete database of extension to mime mappings.

drewish’s picture

Status: Needs review » Fixed

found that mimedetect_mime() wasn't actually checking if the mimedetect_enable_file_binary variable was true before calling file. fixed that so i'm going to go ahead and commit this to HEAD and DRUPAL-5.

drewish’s picture

FileSize
6.45 KB

forgot the patch.

drewish’s picture

FileSize
6.46 KB

here's what went into D5

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.