Browse Source

Add handling of deprecated 'image/tif' mimetype when determining an extension.

pull/336/head
Adam Vessey 12 years ago
parent
commit
c4f97e2632
  1. 6
      includes/mime_detect.inc

6
includes/mime_detect.inc

@ -194,6 +194,11 @@ class MimeDetect {
'bin' => 'application/octet-stream', 'bin' => 'application/octet-stream',
); );
protected $protectedFileExtensions; protected $protectedFileExtensions;
protected $extensionExceptions = array(
// XXX: Deprecated... Only here due to old 'tif' => 'image/tif' mapping...
// The correct MIMEtype is 'image/tiff'.
'image/tif' => 'tif',
);
protected $systemTypes; protected $systemTypes;
protected $systemExts; protected $systemExts;
protected $etcMimeTypes = '/etc/mime.types'; protected $etcMimeTypes = '/etc/mime.types';
@ -205,6 +210,7 @@ class MimeDetect {
// Populate the reverse shortlist: // Populate the reverse shortlist:
$this->protectedFileExtensions = array_flip($this->protectedMimeTypes); $this->protectedFileExtensions = array_flip($this->protectedMimeTypes);
$this->protectedFileExtensions += $this->extensionExceptions;
// Pick up a local mime.types file if it is available. // Pick up a local mime.types file if it is available.
if (is_readable('mime.types')) { if (is_readable('mime.types')) {

Loading…
Cancel
Save