Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | mimedetect_342636.D5.patch | 6.46 KB | drewish |
#3 | mimedetect_342636.patch | 6.45 KB | drewish |
#1 | mimedetect_342636.patch | 5.44 KB | drewish |
Comments
Comment #1
drewish CreditAttribution: drewish commentedyou'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.
Comment #2
drewish CreditAttribution: drewish commentedfound 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.
Comment #3
drewish CreditAttribution: drewish commentedforgot the patch.
Comment #4
drewish CreditAttribution: drewish commentedhere's what went into D5