- Patch #473652 by Damien Tournoud, catch: removed unneeded loop from file_get_mimetype() and further clean-up.
parent
b8f18b39c2
commit
cbd22269f8
|
@ -1520,366 +1520,39 @@ function file_upload_max_size() {
|
|||
* @param $filename
|
||||
* Name of the file, including extension.
|
||||
* @param $mapping
|
||||
* An optional array of extension to media type mappings in the form
|
||||
* 'extension1|extension2|...' => 'type'.
|
||||
* An optional map of extensions to their mimetypes, in the form:
|
||||
* - 'mimetypes': a list of mimetypes, keyed by an identifier,
|
||||
* - 'extensions': the mapping itself, an associative array in which
|
||||
* the key is the extension and the value is the mimetype identifier.
|
||||
*
|
||||
* @return
|
||||
* The internet media type registered for the extension or application/octet-stream for unknown extensions.
|
||||
*/
|
||||
function file_get_mimetype($filename, $mapping = NULL) {
|
||||
if (!is_array($mapping)) {
|
||||
$mapping = variable_get('mime_extension_mapping', array(
|
||||
'ez' => 'application/andrew-inset',
|
||||
'atom' => 'application/atom',
|
||||
'atomcat' => 'application/atomcat+xml',
|
||||
'atomsrv' => 'application/atomserv+xml',
|
||||
'cap|pcap' => 'application/cap',
|
||||
'cu' => 'application/cu-seeme',
|
||||
'tsp' => 'application/dsptype',
|
||||
'spl' => 'application/x-futuresplash',
|
||||
'hta' => 'application/hta',
|
||||
'jar' => 'application/java-archive',
|
||||
'ser' => 'application/java-serialized-object',
|
||||
'class' => 'application/java-vm',
|
||||
'hqx' => 'application/mac-binhex40',
|
||||
'cpt' => 'image/x-corelphotopaint',
|
||||
'nb' => 'application/mathematica',
|
||||
'mdb' => 'application/msaccess',
|
||||
'doc|dot' => 'application/msword',
|
||||
'bin' => 'application/octet-stream',
|
||||
'oda' => 'application/oda',
|
||||
'ogg|ogx' => 'application/ogg',
|
||||
'pdf' => 'application/pdf',
|
||||
'key' => 'application/pgp-keys',
|
||||
'pgp' => 'application/pgp-signature',
|
||||
'prf' => 'application/pics-rules',
|
||||
'ps|ai|eps' => 'application/postscript',
|
||||
'rar' => 'application/rar',
|
||||
'rdf' => 'application/rdf+xml',
|
||||
'rss' => 'application/rss+xml',
|
||||
'rtf' => 'application/rtf',
|
||||
'smi|smil' => 'application/smil',
|
||||
'wpd' => 'application/wordperfect',
|
||||
'wp5' => 'application/wordperfect5.1',
|
||||
'xhtml|xht' => 'application/xhtml+xml',
|
||||
'xml|xsl' => 'application/xml',
|
||||
'zip' => 'application/zip',
|
||||
'cdy' => 'application/vnd.cinderella',
|
||||
'kml' => 'application/vnd.google-earth.kml+xml',
|
||||
'kmz' => 'application/vnd.google-earth.kmz',
|
||||
'xul' => 'application/vnd.mozilla.xul+xml',
|
||||
'xls|xlb|xlt' => 'application/vnd.ms-excel',
|
||||
'cat' => 'application/vnd.ms-pki.seccat',
|
||||
'stl' => 'application/vnd.ms-pki.stl',
|
||||
'ppt|pps' => 'application/vnd.ms-powerpoint',
|
||||
'odc' => 'application/vnd.oasis.opendocument.chart',
|
||||
'odb' => 'application/vnd.oasis.opendocument.database',
|
||||
'odf' => 'application/vnd.oasis.opendocument.formula',
|
||||
'odg' => 'application/vnd.oasis.opendocument.graphics',
|
||||
'otg' => 'application/vnd.oasis.opendocument.graphics-template',
|
||||
'odi' => 'application/vnd.oasis.opendocument.image',
|
||||
'odp' => 'application/vnd.oasis.opendocument.presentation',
|
||||
'otp' => 'application/vnd.oasis.opendocument.presentation-template',
|
||||
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
|
||||
'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template',
|
||||
'odt' => 'application/vnd.oasis.opendocument.text',
|
||||
'odm' => 'application/vnd.oasis.opendocument.text-master',
|
||||
'ott' => 'application/vnd.oasis.opendocument.text-template',
|
||||
'oth' => 'application/vnd.oasis.opendocument.text-web',
|
||||
'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
|
||||
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
|
||||
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||
'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
|
||||
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
|
||||
'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
|
||||
'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
|
||||
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
|
||||
'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
|
||||
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
|
||||
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
|
||||
'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
|
||||
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
|
||||
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
|
||||
'cod' => 'application/vnd.rim.cod',
|
||||
'mmf' => 'application/vnd.smaf',
|
||||
'sdc' => 'application/vnd.stardivision.calc',
|
||||
'sds' => 'application/vnd.stardivision.chart',
|
||||
'sda' => 'application/vnd.stardivision.draw',
|
||||
'sdd' => 'application/vnd.stardivision.impress',
|
||||
'sdf' => 'application/vnd.stardivision.math',
|
||||
'sdw' => 'application/vnd.stardivision.writer',
|
||||
'sgl' => 'application/vnd.stardivision.writer-global',
|
||||
'sxc' => 'application/vnd.sun.xml.calc',
|
||||
'stc' => 'application/vnd.sun.xml.calc.template',
|
||||
'sxd' => 'application/vnd.sun.xml.draw',
|
||||
'std' => 'application/vnd.sun.xml.draw.template',
|
||||
'sxi' => 'application/vnd.sun.xml.impress',
|
||||
'sti' => 'application/vnd.sun.xml.impress.template',
|
||||
'sxm' => 'application/vnd.sun.xml.math',
|
||||
'sxw' => 'application/vnd.sun.xml.writer',
|
||||
'sxg' => 'application/vnd.sun.xml.writer.global',
|
||||
'stw' => 'application/vnd.sun.xml.writer.template',
|
||||
'sis' => 'application/vnd.symbian.install',
|
||||
'vsd' => 'application/vnd.visio',
|
||||
'wbxml' => 'application/vnd.wap.wbxml',
|
||||
'wmlc' => 'application/vnd.wap.wmlc',
|
||||
'wmlsc' => 'application/vnd.wap.wmlscriptc',
|
||||
'wk' => 'application/x-123',
|
||||
'7z' => 'application/x-7z-compressed',
|
||||
'abw' => 'application/x-abiword',
|
||||
'dmg' => 'application/x-apple-diskimage',
|
||||
'bcpio' => 'application/x-bcpio',
|
||||
'torrent' => 'application/x-bittorrent',
|
||||
'cab' => 'application/x-cab',
|
||||
'cbr' => 'application/x-cbr',
|
||||
'cbz' => 'application/x-cbz',
|
||||
'cdf' => 'application/x-cdf',
|
||||
'vcd' => 'application/x-cdlink',
|
||||
'pgn' => 'application/x-chess-pgn',
|
||||
'cpio' => 'application/x-cpio',
|
||||
'csh' => 'text/x-csh',
|
||||
'deb|udeb' => 'application/x-debian-package',
|
||||
'dcr|dir|dxr' => 'application/x-director',
|
||||
'dms' => 'application/x-dms',
|
||||
'wad' => 'application/x-doom',
|
||||
'dvi' => 'application/x-dvi',
|
||||
'rhtml' => 'application/x-httpd-eruby',
|
||||
'flac' => 'application/x-flac',
|
||||
'pfa|pfb|gsf|pcf|pcf.Z' => 'application/x-font',
|
||||
'mm' => 'application/x-freemind',
|
||||
'gnumeric' => 'application/x-gnumeric',
|
||||
'sgf' => 'application/x-go-sgf',
|
||||
'gcf' => 'application/x-graphing-calculator',
|
||||
'gtar|tgz|taz' => 'application/x-gtar',
|
||||
'hdf' => 'application/x-hdf',
|
||||
'phtml|pht|php' => 'application/x-httpd-php',
|
||||
'phps' => 'application/x-httpd-php-source',
|
||||
'php3' => 'application/x-httpd-php3',
|
||||
'php3p' => 'application/x-httpd-php3-preprocessed',
|
||||
'php4' => 'application/x-httpd-php4',
|
||||
'ica' => 'application/x-ica',
|
||||
'ins|isp' => 'application/x-internet-signup',
|
||||
'iii' => 'application/x-iphone',
|
||||
'iso' => 'application/x-iso9660-image',
|
||||
'jnlp' => 'application/x-java-jnlp-file',
|
||||
'js' => 'application/x-javascript',
|
||||
'jmz' => 'application/x-jmol',
|
||||
'chrt' => 'application/x-kchart',
|
||||
'kil' => 'application/x-killustrator',
|
||||
'skp|skd|skt|skm' => 'application/x-koan',
|
||||
'kpr|kpt' => 'application/x-kpresenter',
|
||||
'ksp' => 'application/x-kspread',
|
||||
'kwd|kwt' => 'application/x-kword',
|
||||
'latex' => 'application/x-latex',
|
||||
'lha' => 'application/x-lha',
|
||||
'lyx' => 'application/x-lyx',
|
||||
'lzh' => 'application/x-lzh',
|
||||
'lzx' => 'application/x-lzx',
|
||||
'frm|maker|frame|fm|fb|book|fbdoc' => 'application/x-maker',
|
||||
'mif' => 'application/x-mif',
|
||||
'wmd' => 'application/x-ms-wmd',
|
||||
'wmz' => 'application/x-ms-wmz',
|
||||
'com|exe|bat|dll' => 'application/x-msdos-program',
|
||||
'msi' => 'application/x-msi',
|
||||
'nc' => 'application/x-netcdf',
|
||||
'pac' => 'application/x-ns-proxy-autoconfig',
|
||||
'nwc' => 'application/x-nwc',
|
||||
'o' => 'application/x-object',
|
||||
'oza' => 'application/x-oz-application',
|
||||
'p7r' => 'application/x-pkcs7-certreqresp',
|
||||
'crl' => 'application/x-pkcs7-crl',
|
||||
'pyc|pyo' => 'application/x-python-code',
|
||||
'qtl' => 'application/x-quicktimeplayer',
|
||||
'rpm' => 'application/x-redhat-package-manager',
|
||||
'sh' => 'text/x-sh',
|
||||
'shar' => 'application/x-shar',
|
||||
'swf|swfl' => 'application/x-shockwave-flash',
|
||||
'sit|sitx' => 'application/x-stuffit',
|
||||
'sv4cpio' => 'application/x-sv4cpio',
|
||||
'sv4crc' => 'application/x-sv4crc',
|
||||
'tar' => 'application/x-tar',
|
||||
'tcl' => 'application/x-tcl',
|
||||
'gf' => 'application/x-tex-gf',
|
||||
'pk' => 'application/x-tex-pk',
|
||||
'texinfo|texi' => 'application/x-texinfo',
|
||||
'~|%|bak|old|sik' => 'application/x-trash',
|
||||
't|tr|roff' => 'application/x-troff',
|
||||
'man' => 'application/x-troff-man',
|
||||
'me' => 'application/x-troff-me',
|
||||
'ms' => 'application/x-troff-ms',
|
||||
'ustar' => 'application/x-ustar',
|
||||
'src' => 'application/x-wais-source',
|
||||
'wz' => 'application/x-wingz',
|
||||
'crt' => 'application/x-x509-ca-cert',
|
||||
'xcf' => 'application/x-xcf',
|
||||
'fig' => 'application/x-xfig',
|
||||
'xpi' => 'application/x-xpinstall',
|
||||
'au|snd' => 'audio/basic',
|
||||
'mid|midi|kar' => 'audio/midi',
|
||||
'mpga|mpega|mp2|mp3|m4a' => 'audio/mpeg',
|
||||
'm3u' => 'audio/x-mpegurl',
|
||||
'oga|spx' => 'audio/ogg',
|
||||
'sid' => 'audio/prs.sid',
|
||||
'aif|aiff|aifc' => 'audio/x-aiff',
|
||||
'gsm' => 'audio/x-gsm',
|
||||
'wma' => 'audio/x-ms-wma',
|
||||
'wax' => 'audio/x-ms-wax',
|
||||
'ra|rm|ram' => 'audio/x-pn-realaudio',
|
||||
'ra' => 'audio/x-realaudio',
|
||||
'pls' => 'audio/x-scpls',
|
||||
'sd2' => 'audio/x-sd2',
|
||||
'wav' => 'audio/x-wav',
|
||||
'alc' => 'chemical/x-alchemy',
|
||||
'cac|cache' => 'chemical/x-cache',
|
||||
'csf' => 'chemical/x-cache-csf',
|
||||
'cbin|cascii|ctab' => 'chemical/x-cactvs-binary',
|
||||
'cdx' => 'chemical/x-cdx',
|
||||
'cer' => 'chemical/x-cerius',
|
||||
'c3d' => 'chemical/x-chem3d',
|
||||
'chm' => 'chemical/x-chemdraw',
|
||||
'cif' => 'chemical/x-cif',
|
||||
'cmdf' => 'chemical/x-cmdf',
|
||||
'cml' => 'chemical/x-cml',
|
||||
'cpa' => 'chemical/x-compass',
|
||||
'bsd' => 'chemical/x-crossfire',
|
||||
'csml|csm' => 'chemical/x-csml',
|
||||
'ctx' => 'chemical/x-ctx',
|
||||
'cxf|cef' => 'chemical/x-cxf',
|
||||
'emb|embl' => 'chemical/x-embl-dl-nucleotide',
|
||||
'spc' => 'chemical/x-galactic-spc',
|
||||
'inp|gam|gamin' => 'chemical/x-gamess-input',
|
||||
'fch|fchk' => 'chemical/x-gaussian-checkpoint',
|
||||
'cub' => 'chemical/x-gaussian-cube',
|
||||
'gau|gjc|gjf' => 'chemical/x-gaussian-input',
|
||||
'gal' => 'chemical/x-gaussian-log',
|
||||
'gcg' => 'chemical/x-gcg8-sequence',
|
||||
'gen' => 'chemical/x-genbank',
|
||||
'hin' => 'chemical/x-hin',
|
||||
'istr|ist' => 'chemical/x-isostar',
|
||||
'jdx|dx' => 'chemical/x-jcamp-dx',
|
||||
'kin' => 'chemical/x-kinemage',
|
||||
'mcm' => 'chemical/x-macmolecule',
|
||||
'mmd|mmod' => 'chemical/x-macromodel-input',
|
||||
'mol' => 'chemical/x-mdl-molfile',
|
||||
'rd' => 'chemical/x-mdl-rdfile',
|
||||
'rxn' => 'chemical/x-mdl-rxnfile',
|
||||
'sd|sdf' => 'chemical/x-mdl-sdfile',
|
||||
'tgf' => 'chemical/x-mdl-tgf',
|
||||
'mcif' => 'chemical/x-mmcif',
|
||||
'mol2' => 'chemical/x-mol2',
|
||||
'b' => 'chemical/x-molconn-Z',
|
||||
'gpt' => 'chemical/x-mopac-graph',
|
||||
'mop|mopcrt|mpc|dat|zmt' => 'chemical/x-mopac-input',
|
||||
'moo' => 'chemical/x-mopac-out',
|
||||
'mvb' => 'chemical/x-mopac-vib',
|
||||
'asn' => 'chemical/x-ncbi-asn1-spec',
|
||||
'prt|ent' => 'chemical/x-ncbi-asn1-ascii',
|
||||
'val|aso' => 'chemical/x-ncbi-asn1-binary',
|
||||
'pdb|ent' => 'chemical/x-pdb',
|
||||
'ros' => 'chemical/x-rosdal',
|
||||
'sw' => 'chemical/x-swissprot',
|
||||
'vms' => 'chemical/x-vamas-iso14976',
|
||||
'vmd' => 'chemical/x-vmd',
|
||||
'xtel' => 'chemical/x-xtel',
|
||||
'xyz' => 'chemical/x-xyz',
|
||||
'gif' => 'image/gif',
|
||||
'ief' => 'image/ief',
|
||||
'jpeg|jpg|jpe' => 'image/jpeg',
|
||||
'pcx' => 'image/pcx',
|
||||
'png' => 'image/png',
|
||||
'svg|svgz' => 'image/svg+xml',
|
||||
'tiff|tif' => 'image/tiff',
|
||||
'djvu|djv' => 'image/vnd.djvu',
|
||||
'wbmp' => 'image/vnd.wap.wbmp',
|
||||
'ras' => 'image/x-cmu-raster',
|
||||
'cdr' => 'image/x-coreldraw',
|
||||
'pat' => 'image/x-coreldrawpattern',
|
||||
'cdt' => 'image/x-coreldrawtemplate',
|
||||
'ico' => 'image/vnd.microsoft.icon',
|
||||
'art' => 'image/x-jg',
|
||||
'jng' => 'image/x-jng',
|
||||
'bmp' => 'image/x-ms-bmp',
|
||||
'psd' => 'image/x-photoshop',
|
||||
'pnm' => 'image/x-portable-anymap',
|
||||
'pbm' => 'image/x-portable-bitmap',
|
||||
'pgm' => 'image/x-portable-graymap',
|
||||
'ppm' => 'image/x-portable-pixmap',
|
||||
'rgb' => 'image/x-rgb',
|
||||
'xbm' => 'image/x-xbitmap',
|
||||
'xpm' => 'image/x-xpixmap',
|
||||
'xwd' => 'image/x-xwindowdump',
|
||||
'eml' => 'message/rfc822',
|
||||
'igs|iges' => 'model/iges',
|
||||
'msh|mesh|silo' => 'model/mesh',
|
||||
'wrl|vrml' => 'model/vrml',
|
||||
'ics|icz' => 'text/calendar',
|
||||
'css' => 'text/css',
|
||||
'csv' => 'text/csv',
|
||||
'323' => 'text/h323',
|
||||
'html|htm|shtml' => 'text/html',
|
||||
'uls' => 'text/iuls',
|
||||
'mml' => 'text/mathml',
|
||||
'asc|txt|text|pot' => 'text/plain',
|
||||
'rtx' => 'text/richtext',
|
||||
'sct|wsc' => 'text/scriptlet',
|
||||
'tm|ts' => 'text/texmacs',
|
||||
'tsv' => 'text/tab-separated-values',
|
||||
'jad' => 'text/vnd.sun.j2me.app-descriptor',
|
||||
'wml' => 'text/vnd.wap.wml',
|
||||
'wmls' => 'text/vnd.wap.wmlscript',
|
||||
'bib' => 'text/x-bibtex',
|
||||
'boo' => 'text/x-boo',
|
||||
'h++|hpp|hxx|hh' => 'text/x-c++hdr',
|
||||
'c++|cpp|cxx|cc' => 'text/x-c++src',
|
||||
'h' => 'text/x-chdr',
|
||||
'htc' => 'text/x-component',
|
||||
'c' => 'text/x-csrc',
|
||||
'd' => 'text/x-dsrc',
|
||||
'diff|patch' => 'text/x-diff',
|
||||
'hs' => 'text/x-haskell',
|
||||
'java' => 'text/x-java',
|
||||
'lhs' => 'text/x-literate-haskell',
|
||||
'moc' => 'text/x-moc',
|
||||
'p|pas' => 'text/x-pascal',
|
||||
'gcd' => 'text/x-pcs-gcd',
|
||||
'pl|pm' => 'text/x-perl',
|
||||
'py' => 'text/x-python',
|
||||
'etx' => 'text/x-setext',
|
||||
'tcl|tk' => 'text/x-tcl',
|
||||
'tex|ltx|sty|cls' => 'text/x-tex',
|
||||
'vcs' => 'text/x-vcalendar',
|
||||
'vcf' => 'text/x-vcard',
|
||||
'3gp' => 'video/3gpp',
|
||||
'dl' => 'video/dl',
|
||||
'dif|dv' => 'video/dv',
|
||||
'fli' => 'video/fli',
|
||||
'gl' => 'video/gl',
|
||||
'mpeg|mpg|mpe' => 'video/mpeg',
|
||||
'mp4' => 'video/mp4',
|
||||
'ogv' => 'video/ogg',
|
||||
'qt|mov' => 'video/quicktime',
|
||||
'mxu' => 'video/vnd.mpegurl',
|
||||
'lsf|lsx' => 'video/x-la-asf',
|
||||
'mng' => 'video/x-mng',
|
||||
'asf|asx' => 'video/x-ms-asf',
|
||||
'wm' => 'video/x-ms-wm',
|
||||
'wmv' => 'video/x-ms-wmv',
|
||||
'wmx' => 'video/x-ms-wmx',
|
||||
'wvx' => 'video/x-ms-wvx',
|
||||
'avi' => 'video/x-msvideo',
|
||||
'movie' => 'video/x-sgi-movie',
|
||||
'ice' => 'x-conference/x-cooltalk',
|
||||
'sisx' => 'x-epoc/x-sisx-app',
|
||||
'vrm|vrml|wrl' => 'x-world/x-vrml',
|
||||
'xps' => 'application/vnd.ms-xpsdocument',
|
||||
));
|
||||
if (!isset($mapping)) {
|
||||
$mapping = variable_get('mime_extension_mapping', NULL);
|
||||
if (!isset($mapping) && drupal_function_exists('file_default_mimetype_mapping')) {
|
||||
// The default file map, defined in file.mimetypes.inc is quite big.
|
||||
// We only load it when necessary.
|
||||
$mapping = file_default_mimetype_mapping();
|
||||
}
|
||||
}
|
||||
foreach ($mapping as $ext_preg => $mime_match) {
|
||||
if (preg_match('!\.(' . $ext_preg . ')$!i', $filename)) {
|
||||
return $mime_match;
|
||||
|
||||
$extension = '';
|
||||
$file_parts = explode('.', $filename);
|
||||
|
||||
// Remove the first part: a full filename should not match an extension.
|
||||
array_shift($file_parts);
|
||||
|
||||
// Iterate over the file parts, trying to find a match.
|
||||
// For my.awesome.image.jpeg, we try:
|
||||
// - jpeg
|
||||
// - image.jpeg, and
|
||||
// - awesome.image.jpeg
|
||||
while ($additional_part = array_pop($file_parts)) {
|
||||
$extension = $additional_part . ($extension ? '.' . $extension : '');
|
||||
if (isset($mapping['extensions'][$extension])) {
|
||||
return $mapping['mimetypes'][$mapping['extensions'][$extension]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,818 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Default MIME extension mapping.
|
||||
*/
|
||||
function file_default_mimetype_mapping() {
|
||||
return array(
|
||||
'mimetypes' => array(
|
||||
0 => 'application/andrew-inset',
|
||||
1 => 'application/atom',
|
||||
2 => 'application/atomcat+xml',
|
||||
3 => 'application/atomserv+xml',
|
||||
4 => 'application/cap',
|
||||
5 => 'application/cu-seeme',
|
||||
6 => 'application/dsptype',
|
||||
7 => 'application/hta',
|
||||
8 => 'application/java-archive',
|
||||
9 => 'application/java-serialized-object',
|
||||
10 => 'application/java-vm',
|
||||
11 => 'application/mac-binhex40',
|
||||
12 => 'application/mathematica',
|
||||
13 => 'application/msaccess',
|
||||
14 => 'application/msword',
|
||||
15 => 'application/octet-stream',
|
||||
16 => 'application/oda',
|
||||
17 => 'application/ogg',
|
||||
18 => 'application/pdf',
|
||||
19 => 'application/pgp-keys',
|
||||
20 => 'application/pgp-signature',
|
||||
21 => 'application/pics-rules',
|
||||
22 => 'application/postscript',
|
||||
23 => 'application/rar',
|
||||
24 => 'application/rdf+xml',
|
||||
25 => 'application/rss+xml',
|
||||
26 => 'application/rtf',
|
||||
27 => 'application/smil',
|
||||
28 => 'application/vnd.cinderella',
|
||||
29 => 'application/vnd.google-earth.kml+xml',
|
||||
30 => 'application/vnd.google-earth.kmz',
|
||||
31 => 'application/vnd.mozilla.xul+xml',
|
||||
32 => 'application/vnd.ms-excel',
|
||||
33 => 'application/vnd.ms-excel.addin.macroEnabled.12',
|
||||
34 => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
|
||||
35 => 'application/vnd.ms-excel.sheet.macroEnabled.12',
|
||||
36 => 'application/vnd.ms-excel.template.macroEnabled.12',
|
||||
37 => 'application/vnd.ms-pki.seccat',
|
||||
38 => 'application/vnd.ms-pki.stl',
|
||||
39 => 'application/vnd.ms-powerpoint',
|
||||
40 => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
|
||||
41 => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
|
||||
42 => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
|
||||
43 => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
|
||||
44 => 'application/vnd.ms-word.document.macroEnabled.12',
|
||||
45 => 'application/vnd.ms-word.template.macroEnabled.12',
|
||||
46 => 'application/vnd.ms-xpsdocument',
|
||||
47 => 'application/vnd.oasis.opendocument.chart',
|
||||
48 => 'application/vnd.oasis.opendocument.database',
|
||||
49 => 'application/vnd.oasis.opendocument.formula',
|
||||
50 => 'application/vnd.oasis.opendocument.graphics',
|
||||
51 => 'application/vnd.oasis.opendocument.graphics-template',
|
||||
52 => 'application/vnd.oasis.opendocument.image',
|
||||
53 => 'application/vnd.oasis.opendocument.presentation',
|
||||
54 => 'application/vnd.oasis.opendocument.presentation-template',
|
||||
55 => 'application/vnd.oasis.opendocument.spreadsheet',
|
||||
56 => 'application/vnd.oasis.opendocument.spreadsheet-template',
|
||||
57 => 'application/vnd.oasis.opendocument.text',
|
||||
58 => 'application/vnd.oasis.opendocument.text-master',
|
||||
59 => 'application/vnd.oasis.opendocument.text-template',
|
||||
60 => 'application/vnd.oasis.opendocument.text-web',
|
||||
61 => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
62 => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
|
||||
63 => 'application/vnd.openxmlformats-officedocument.presentationml.template',
|
||||
64 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
65 => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
|
||||
66 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
67 => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
|
||||
68 => 'application/vnd.rim.cod',
|
||||
69 => 'application/vnd.smaf',
|
||||
70 => 'application/vnd.stardivision.calc',
|
||||
71 => 'application/vnd.stardivision.chart',
|
||||
72 => 'application/vnd.stardivision.draw',
|
||||
73 => 'application/vnd.stardivision.impress',
|
||||
74 => 'application/vnd.stardivision.math',
|
||||
75 => 'application/vnd.stardivision.writer',
|
||||
76 => 'application/vnd.stardivision.writer-global',
|
||||
77 => 'application/vnd.sun.xml.calc',
|
||||
78 => 'application/vnd.sun.xml.calc.template',
|
||||
79 => 'application/vnd.sun.xml.draw',
|
||||
80 => 'application/vnd.sun.xml.draw.template',
|
||||
81 => 'application/vnd.sun.xml.impress',
|
||||
82 => 'application/vnd.sun.xml.impress.template',
|
||||
83 => 'application/vnd.sun.xml.math',
|
||||
84 => 'application/vnd.sun.xml.writer',
|
||||
85 => 'application/vnd.sun.xml.writer.global',
|
||||
86 => 'application/vnd.sun.xml.writer.template',
|
||||
87 => 'application/vnd.symbian.install',
|
||||
88 => 'application/vnd.visio',
|
||||
89 => 'application/vnd.wap.wbxml',
|
||||
90 => 'application/vnd.wap.wmlc',
|
||||
91 => 'application/vnd.wap.wmlscriptc',
|
||||
92 => 'application/wordperfect',
|
||||
93 => 'application/wordperfect5.1',
|
||||
94 => 'application/x-123',
|
||||
95 => 'application/x-7z-compressed',
|
||||
96 => 'application/x-abiword',
|
||||
97 => 'application/x-apple-diskimage',
|
||||
98 => 'application/x-bcpio',
|
||||
99 => 'application/x-bittorrent',
|
||||
100 => 'application/x-cab',
|
||||
101 => 'application/x-cbr',
|
||||
102 => 'application/x-cbz',
|
||||
103 => 'application/x-cdf',
|
||||
104 => 'application/x-cdlink',
|
||||
105 => 'application/x-chess-pgn',
|
||||
106 => 'application/x-cpio',
|
||||
107 => 'application/x-debian-package',
|
||||
108 => 'application/x-director',
|
||||
109 => 'application/x-dms',
|
||||
110 => 'application/x-doom',
|
||||
111 => 'application/x-dvi',
|
||||
112 => 'application/x-flac',
|
||||
113 => 'application/x-font',
|
||||
114 => 'application/x-freemind',
|
||||
115 => 'application/x-futuresplash',
|
||||
116 => 'application/x-gnumeric',
|
||||
117 => 'application/x-go-sgf',
|
||||
118 => 'application/x-graphing-calculator',
|
||||
119 => 'application/x-gtar',
|
||||
120 => 'application/x-hdf',
|
||||
121 => 'application/x-httpd-eruby',
|
||||
122 => 'application/x-httpd-php',
|
||||
123 => 'application/x-httpd-php-source',
|
||||
124 => 'application/x-httpd-php3',
|
||||
125 => 'application/x-httpd-php3-preprocessed',
|
||||
126 => 'application/x-httpd-php4',
|
||||
127 => 'application/x-ica',
|
||||
128 => 'application/x-internet-signup',
|
||||
129 => 'application/x-iphone',
|
||||
130 => 'application/x-iso9660-image',
|
||||
131 => 'application/x-java-jnlp-file',
|
||||
132 => 'application/x-javascript',
|
||||
133 => 'application/x-jmol',
|
||||
134 => 'application/x-kchart',
|
||||
135 => 'application/x-killustrator',
|
||||
136 => 'application/x-koan',
|
||||
137 => 'application/x-kpresenter',
|
||||
138 => 'application/x-kspread',
|
||||
139 => 'application/x-kword',
|
||||
140 => 'application/x-latex',
|
||||
141 => 'application/x-lha',
|
||||
142 => 'application/x-lyx',
|
||||
143 => 'application/x-lzh',
|
||||
144 => 'application/x-lzx',
|
||||
145 => 'application/x-maker',
|
||||
146 => 'application/x-mif',
|
||||
147 => 'application/x-ms-wmd',
|
||||
148 => 'application/x-ms-wmz',
|
||||
149 => 'application/x-msdos-program',
|
||||
150 => 'application/x-msi',
|
||||
151 => 'application/x-netcdf',
|
||||
152 => 'application/x-ns-proxy-autoconfig',
|
||||
153 => 'application/x-nwc',
|
||||
154 => 'application/x-object',
|
||||
155 => 'application/x-oz-application',
|
||||
156 => 'application/x-pkcs7-certreqresp',
|
||||
157 => 'application/x-pkcs7-crl',
|
||||
158 => 'application/x-python-code',
|
||||
159 => 'application/x-quicktimeplayer',
|
||||
160 => 'application/x-redhat-package-manager',
|
||||
161 => 'application/x-shar',
|
||||
162 => 'application/x-shockwave-flash',
|
||||
163 => 'application/x-stuffit',
|
||||
164 => 'application/x-sv4cpio',
|
||||
165 => 'application/x-sv4crc',
|
||||
166 => 'application/x-tar',
|
||||
167 => 'application/x-tcl',
|
||||
168 => 'application/x-tex-gf',
|
||||
169 => 'application/x-tex-pk',
|
||||
170 => 'application/x-texinfo',
|
||||
171 => 'application/x-trash',
|
||||
172 => 'application/x-troff',
|
||||
173 => 'application/x-troff-man',
|
||||
174 => 'application/x-troff-me',
|
||||
175 => 'application/x-troff-ms',
|
||||
176 => 'application/x-ustar',
|
||||
177 => 'application/x-wais-source',
|
||||
178 => 'application/x-wingz',
|
||||
179 => 'application/x-x509-ca-cert',
|
||||
180 => 'application/x-xcf',
|
||||
181 => 'application/x-xfig',
|
||||
182 => 'application/x-xpinstall',
|
||||
183 => 'application/xhtml+xml',
|
||||
184 => 'application/xml',
|
||||
185 => 'application/zip',
|
||||
186 => 'audio/basic',
|
||||
187 => 'audio/midi',
|
||||
188 => 'audio/mpeg',
|
||||
189 => 'audio/ogg',
|
||||
190 => 'audio/prs.sid',
|
||||
191 => 'audio/x-aiff',
|
||||
192 => 'audio/x-gsm',
|
||||
193 => 'audio/x-mpegurl',
|
||||
194 => 'audio/x-ms-wax',
|
||||
195 => 'audio/x-ms-wma',
|
||||
196 => 'audio/x-pn-realaudio',
|
||||
197 => 'audio/x-realaudio',
|
||||
198 => 'audio/x-scpls',
|
||||
199 => 'audio/x-sd2',
|
||||
200 => 'audio/x-wav',
|
||||
201 => 'chemical/x-alchemy',
|
||||
202 => 'chemical/x-cache',
|
||||
203 => 'chemical/x-cache-csf',
|
||||
204 => 'chemical/x-cactvs-binary',
|
||||
205 => 'chemical/x-cdx',
|
||||
206 => 'chemical/x-cerius',
|
||||
207 => 'chemical/x-chem3d',
|
||||
208 => 'chemical/x-chemdraw',
|
||||
209 => 'chemical/x-cif',
|
||||
210 => 'chemical/x-cmdf',
|
||||
211 => 'chemical/x-cml',
|
||||
212 => 'chemical/x-compass',
|
||||
213 => 'chemical/x-crossfire',
|
||||
214 => 'chemical/x-csml',
|
||||
215 => 'chemical/x-ctx',
|
||||
216 => 'chemical/x-cxf',
|
||||
217 => 'chemical/x-embl-dl-nucleotide',
|
||||
218 => 'chemical/x-galactic-spc',
|
||||
219 => 'chemical/x-gamess-input',
|
||||
220 => 'chemical/x-gaussian-checkpoint',
|
||||
221 => 'chemical/x-gaussian-cube',
|
||||
222 => 'chemical/x-gaussian-input',
|
||||
223 => 'chemical/x-gaussian-log',
|
||||
224 => 'chemical/x-gcg8-sequence',
|
||||
225 => 'chemical/x-genbank',
|
||||
226 => 'chemical/x-hin',
|
||||
227 => 'chemical/x-isostar',
|
||||
228 => 'chemical/x-jcamp-dx',
|
||||
229 => 'chemical/x-kinemage',
|
||||
230 => 'chemical/x-macmolecule',
|
||||
231 => 'chemical/x-macromodel-input',
|
||||
232 => 'chemical/x-mdl-molfile',
|
||||
233 => 'chemical/x-mdl-rdfile',
|
||||
234 => 'chemical/x-mdl-rxnfile',
|
||||
235 => 'chemical/x-mdl-sdfile',
|
||||
236 => 'chemical/x-mdl-tgf',
|
||||
237 => 'chemical/x-mmcif',
|
||||
238 => 'chemical/x-mol2',
|
||||
239 => 'chemical/x-molconn-Z',
|
||||
240 => 'chemical/x-mopac-graph',
|
||||
241 => 'chemical/x-mopac-input',
|
||||
242 => 'chemical/x-mopac-out',
|
||||
243 => 'chemical/x-mopac-vib',
|
||||
244 => 'chemical/x-ncbi-asn1-ascii',
|
||||
245 => 'chemical/x-ncbi-asn1-binary',
|
||||
246 => 'chemical/x-ncbi-asn1-spec',
|
||||
247 => 'chemical/x-pdb',
|
||||
248 => 'chemical/x-rosdal',
|
||||
249 => 'chemical/x-swissprot',
|
||||
250 => 'chemical/x-vamas-iso14976',
|
||||
251 => 'chemical/x-vmd',
|
||||
252 => 'chemical/x-xtel',
|
||||
253 => 'chemical/x-xyz',
|
||||
254 => 'image/gif',
|
||||
255 => 'image/ief',
|
||||
256 => 'image/jpeg',
|
||||
257 => 'image/pcx',
|
||||
258 => 'image/png',
|
||||
259 => 'image/svg+xml',
|
||||
260 => 'image/tiff',
|
||||
261 => 'image/vnd.djvu',
|
||||
262 => 'image/vnd.microsoft.icon',
|
||||
263 => 'image/vnd.wap.wbmp',
|
||||
264 => 'image/x-cmu-raster',
|
||||
265 => 'image/x-coreldraw',
|
||||
266 => 'image/x-coreldrawpattern',
|
||||
267 => 'image/x-coreldrawtemplate',
|
||||
268 => 'image/x-corelphotopaint',
|
||||
269 => 'image/x-jg',
|
||||
270 => 'image/x-jng',
|
||||
271 => 'image/x-ms-bmp',
|
||||
272 => 'image/x-photoshop',
|
||||
273 => 'image/x-portable-anymap',
|
||||
274 => 'image/x-portable-bitmap',
|
||||
275 => 'image/x-portable-graymap',
|
||||
276 => 'image/x-portable-pixmap',
|
||||
277 => 'image/x-rgb',
|
||||
278 => 'image/x-xbitmap',
|
||||
279 => 'image/x-xpixmap',
|
||||
280 => 'image/x-xwindowdump',
|
||||
281 => 'message/rfc822',
|
||||
282 => 'model/iges',
|
||||
283 => 'model/mesh',
|
||||
284 => 'model/vrml',
|
||||
285 => 'text/calendar',
|
||||
286 => 'text/css',
|
||||
287 => 'text/csv',
|
||||
288 => 'text/h323',
|
||||
289 => 'text/html',
|
||||
290 => 'text/iuls',
|
||||
291 => 'text/mathml',
|
||||
292 => 'text/plain',
|
||||
293 => 'text/richtext',
|
||||
294 => 'text/scriptlet',
|
||||
295 => 'text/tab-separated-values',
|
||||
296 => 'text/texmacs',
|
||||
297 => 'text/vnd.sun.j2me.app-descriptor',
|
||||
298 => 'text/vnd.wap.wml',
|
||||
299 => 'text/vnd.wap.wmlscript',
|
||||
300 => 'text/x-bibtex',
|
||||
301 => 'text/x-boo',
|
||||
302 => 'text/x-c++hdr',
|
||||
303 => 'text/x-c++src',
|
||||
304 => 'text/x-chdr',
|
||||
305 => 'text/x-component',
|
||||
306 => 'text/x-csh',
|
||||
307 => 'text/x-csrc',
|
||||
308 => 'text/x-diff',
|
||||
309 => 'text/x-dsrc',
|
||||
310 => 'text/x-haskell',
|
||||
311 => 'text/x-java',
|
||||
312 => 'text/x-literate-haskell',
|
||||
313 => 'text/x-moc',
|
||||
314 => 'text/x-pascal',
|
||||
315 => 'text/x-pcs-gcd',
|
||||
316 => 'text/x-perl',
|
||||
317 => 'text/x-python',
|
||||
318 => 'text/x-setext',
|
||||
319 => 'text/x-sh',
|
||||
320 => 'text/x-tcl',
|
||||
321 => 'text/x-tex',
|
||||
322 => 'text/x-vcalendar',
|
||||
323 => 'text/x-vcard',
|
||||
324 => 'video/3gpp',
|
||||
325 => 'video/dl',
|
||||
326 => 'video/dv',
|
||||
327 => 'video/fli',
|
||||
328 => 'video/gl',
|
||||
329 => 'video/mp4',
|
||||
330 => 'video/mpeg',
|
||||
331 => 'video/ogg',
|
||||
332 => 'video/quicktime',
|
||||
333 => 'video/vnd.mpegurl',
|
||||
334 => 'video/x-la-asf',
|
||||
335 => 'video/x-mng',
|
||||
336 => 'video/x-ms-asf',
|
||||
337 => 'video/x-ms-wm',
|
||||
338 => 'video/x-ms-wmv',
|
||||
339 => 'video/x-ms-wmx',
|
||||
340 => 'video/x-ms-wvx',
|
||||
341 => 'video/x-msvideo',
|
||||
342 => 'video/x-sgi-movie',
|
||||
343 => 'x-conference/x-cooltalk',
|
||||
344 => 'x-epoc/x-sisx-app',
|
||||
345 => 'x-world/x-vrml',
|
||||
),
|
||||
'extensions' => array(
|
||||
'ez' => 0,
|
||||
'atom' => 1,
|
||||
'atomcat' => 2,
|
||||
'atomsrv' => 3,
|
||||
'cap' => 4,
|
||||
'pcap' => 4,
|
||||
'cu' => 5,
|
||||
'tsp' => 6,
|
||||
'hta' => 7,
|
||||
'jar' => 8,
|
||||
'ser' => 9,
|
||||
'class' => 10,
|
||||
'hqx' => 11,
|
||||
'nb' => 12,
|
||||
'mdb' => 13,
|
||||
'dot' => 14,
|
||||
'doc' => 14,
|
||||
'bin' => 15,
|
||||
'oda' => 16,
|
||||
'ogg' => 17,
|
||||
'ogx' => 17,
|
||||
'pdf' => 18,
|
||||
'key' => 19,
|
||||
'pgp' => 20,
|
||||
'prf' => 21,
|
||||
'eps' => 22,
|
||||
'ai' => 22,
|
||||
'ps' => 22,
|
||||
'rar' => 23,
|
||||
'rdf' => 24,
|
||||
'rss' => 25,
|
||||
'rtf' => 26,
|
||||
'smi' => 27,
|
||||
'smil' => 27,
|
||||
'cdy' => 28,
|
||||
'kml' => 29,
|
||||
'kmz' => 30,
|
||||
'xul' => 31,
|
||||
'xlb' => 32,
|
||||
'xlt' => 32,
|
||||
'xls' => 32,
|
||||
'xlam' => 33,
|
||||
'xlsb' => 34,
|
||||
'xlsm' => 35,
|
||||
'xltm' => 36,
|
||||
'cat' => 37,
|
||||
'stl' => 38,
|
||||
'pps' => 39,
|
||||
'ppt' => 39,
|
||||
'ppam' => 40,
|
||||
'pptm' => 41,
|
||||
'ppsm' => 42,
|
||||
'potm' => 43,
|
||||
'docm' => 44,
|
||||
'dotm' => 45,
|
||||
'xps' => 46,
|
||||
'odc' => 47,
|
||||
'odb' => 48,
|
||||
'odf' => 49,
|
||||
'odg' => 50,
|
||||
'otg' => 51,
|
||||
'odi' => 52,
|
||||
'odp' => 53,
|
||||
'otp' => 54,
|
||||
'ods' => 55,
|
||||
'ots' => 56,
|
||||
'odt' => 57,
|
||||
'odm' => 58,
|
||||
'ott' => 59,
|
||||
'oth' => 60,
|
||||
'pptx' => 61,
|
||||
'ppsx' => 62,
|
||||
'potx' => 63,
|
||||
'xlsx' => 64,
|
||||
'xltx' => 65,
|
||||
'docx' => 66,
|
||||
'dotx' => 67,
|
||||
'cod' => 68,
|
||||
'mmf' => 69,
|
||||
'sdc' => 70,
|
||||
'sds' => 71,
|
||||
'sda' => 72,
|
||||
'sdd' => 73,
|
||||
'sdw' => 75,
|
||||
'sgl' => 76,
|
||||
'sxc' => 77,
|
||||
'stc' => 78,
|
||||
'sxd' => 79,
|
||||
'std' => 80,
|
||||
'sxi' => 81,
|
||||
'sti' => 82,
|
||||
'sxm' => 83,
|
||||
'sxw' => 84,
|
||||
'sxg' => 85,
|
||||
'stw' => 86,
|
||||
'sis' => 87,
|
||||
'vsd' => 88,
|
||||
'wbxml' => 89,
|
||||
'wmlc' => 90,
|
||||
'wmlsc' => 91,
|
||||
'wpd' => 92,
|
||||
'wp5' => 93,
|
||||
'wk' => 94,
|
||||
'7z' => 95,
|
||||
'abw' => 96,
|
||||
'dmg' => 97,
|
||||
'bcpio' => 98,
|
||||
'torrent' => 99,
|
||||
'cab' => 100,
|
||||
'cbr' => 101,
|
||||
'cbz' => 102,
|
||||
'cdf' => 103,
|
||||
'vcd' => 104,
|
||||
'pgn' => 105,
|
||||
'cpio' => 106,
|
||||
'udeb' => 107,
|
||||
'deb' => 107,
|
||||
'dir' => 108,
|
||||
'dxr' => 108,
|
||||
'dcr' => 108,
|
||||
'dms' => 109,
|
||||
'wad' => 110,
|
||||
'dvi' => 111,
|
||||
'flac' => 112,
|
||||
'pfa' => 113,
|
||||
'pfb' => 113,
|
||||
'pcf' => 113,
|
||||
'gsf' => 113,
|
||||
'pcf.Z' => 113,
|
||||
'mm' => 114,
|
||||
'spl' => 115,
|
||||
'gnumeric' => 116,
|
||||
'sgf' => 117,
|
||||
'gcf' => 118,
|
||||
'taz' => 119,
|
||||
'gtar' => 119,
|
||||
'tgz' => 119,
|
||||
'hdf' => 120,
|
||||
'rhtml' => 121,
|
||||
'phtml' => 122,
|
||||
'pht' => 122,
|
||||
'php' => 122,
|
||||
'phps' => 123,
|
||||
'php3' => 124,
|
||||
'php3p' => 125,
|
||||
'php4' => 126,
|
||||
'ica' => 127,
|
||||
'ins' => 128,
|
||||
'isp' => 128,
|
||||
'iii' => 129,
|
||||
'iso' => 130,
|
||||
'jnlp' => 131,
|
||||
'js' => 132,
|
||||
'jmz' => 133,
|
||||
'chrt' => 134,
|
||||
'kil' => 135,
|
||||
'skp' => 136,
|
||||
'skd' => 136,
|
||||
'skm' => 136,
|
||||
'skt' => 136,
|
||||
'kpr' => 137,
|
||||
'kpt' => 137,
|
||||
'ksp' => 138,
|
||||
'kwd' => 139,
|
||||
'kwt' => 139,
|
||||
'latex' => 140,
|
||||
'lha' => 141,
|
||||
'lyx' => 142,
|
||||
'lzh' => 143,
|
||||
'lzx' => 144,
|
||||
'maker' => 145,
|
||||
'frm' => 145,
|
||||
'frame' => 145,
|
||||
'fm' => 145,
|
||||
'book' => 145,
|
||||
'fb' => 145,
|
||||
'fbdoc' => 145,
|
||||
'mif' => 146,
|
||||
'wmd' => 147,
|
||||
'wmz' => 148,
|
||||
'dll' => 149,
|
||||
'bat' => 149,
|
||||
'exe' => 149,
|
||||
'com' => 149,
|
||||
'msi' => 150,
|
||||
'nc' => 151,
|
||||
'pac' => 152,
|
||||
'nwc' => 153,
|
||||
'o' => 154,
|
||||
'oza' => 155,
|
||||
'p7r' => 156,
|
||||
'crl' => 157,
|
||||
'pyo' => 158,
|
||||
'pyc' => 158,
|
||||
'qtl' => 159,
|
||||
'rpm' => 160,
|
||||
'shar' => 161,
|
||||
'swf' => 162,
|
||||
'swfl' => 162,
|
||||
'sitx' => 163,
|
||||
'sit' => 163,
|
||||
'sv4cpio' => 164,
|
||||
'sv4crc' => 165,
|
||||
'tar' => 166,
|
||||
'gf' => 168,
|
||||
'pk' => 169,
|
||||
'texi' => 170,
|
||||
'texinfo' => 170,
|
||||
'sik' => 171,
|
||||
'~' => 171,
|
||||
'bak' => 171,
|
||||
'%' => 171,
|
||||
'old' => 171,
|
||||
't' => 172,
|
||||
'roff' => 172,
|
||||
'tr' => 172,
|
||||
'man' => 173,
|
||||
'me' => 174,
|
||||
'ms' => 175,
|
||||
'ustar' => 176,
|
||||
'src' => 177,
|
||||
'wz' => 178,
|
||||
'crt' => 179,
|
||||
'xcf' => 180,
|
||||
'fig' => 181,
|
||||
'xpi' => 182,
|
||||
'xht' => 183,
|
||||
'xhtml' => 183,
|
||||
'xml' => 184,
|
||||
'xsl' => 184,
|
||||
'zip' => 185,
|
||||
'au' => 186,
|
||||
'snd' => 186,
|
||||
'mid' => 187,
|
||||
'midi' => 187,
|
||||
'kar' => 187,
|
||||
'mpega' => 188,
|
||||
'mpga' => 188,
|
||||
'm4a' => 188,
|
||||
'mp3' => 188,
|
||||
'mp2' => 188,
|
||||
'oga' => 189,
|
||||
'spx' => 189,
|
||||
'sid' => 190,
|
||||
'aif' => 191,
|
||||
'aiff' => 191,
|
||||
'aifc' => 191,
|
||||
'gsm' => 192,
|
||||
'm3u' => 193,
|
||||
'wax' => 194,
|
||||
'wma' => 195,
|
||||
'rm' => 196,
|
||||
'ram' => 196,
|
||||
'ra' => 197,
|
||||
'pls' => 198,
|
||||
'sd2' => 199,
|
||||
'wav' => 200,
|
||||
'alc' => 201,
|
||||
'cac' => 202,
|
||||
'cache' => 202,
|
||||
'csf' => 203,
|
||||
'cascii' => 204,
|
||||
'cbin' => 204,
|
||||
'ctab' => 204,
|
||||
'cdx' => 205,
|
||||
'cer' => 206,
|
||||
'c3d' => 207,
|
||||
'chm' => 208,
|
||||
'cif' => 209,
|
||||
'cmdf' => 210,
|
||||
'cml' => 211,
|
||||
'cpa' => 212,
|
||||
'bsd' => 213,
|
||||
'csml' => 214,
|
||||
'csm' => 214,
|
||||
'ctx' => 215,
|
||||
'cxf' => 216,
|
||||
'cef' => 216,
|
||||
'emb' => 217,
|
||||
'embl' => 217,
|
||||
'spc' => 218,
|
||||
'gam' => 219,
|
||||
'inp' => 219,
|
||||
'gamin' => 219,
|
||||
'fchk' => 220,
|
||||
'fch' => 220,
|
||||
'cub' => 221,
|
||||
'gau' => 222,
|
||||
'gjf' => 222,
|
||||
'gjc' => 222,
|
||||
'gal' => 223,
|
||||
'gcg' => 224,
|
||||
'gen' => 225,
|
||||
'hin' => 226,
|
||||
'istr' => 227,
|
||||
'ist' => 227,
|
||||
'dx' => 228,
|
||||
'jdx' => 228,
|
||||
'kin' => 229,
|
||||
'mcm' => 230,
|
||||
'mmd' => 231,
|
||||
'mmod' => 231,
|
||||
'mol' => 232,
|
||||
'rd' => 233,
|
||||
'rxn' => 234,
|
||||
'sdf' => 235,
|
||||
'sd' => 235,
|
||||
'tgf' => 236,
|
||||
'mcif' => 237,
|
||||
'mol2' => 238,
|
||||
'b' => 239,
|
||||
'gpt' => 240,
|
||||
'mopcrt' => 241,
|
||||
'zmt' => 241,
|
||||
'mpc' => 241,
|
||||
'dat' => 241,
|
||||
'mop' => 241,
|
||||
'moo' => 242,
|
||||
'mvb' => 243,
|
||||
'prt' => 244,
|
||||
'aso' => 245,
|
||||
'val' => 245,
|
||||
'asn' => 246,
|
||||
'ent' => 247,
|
||||
'pdb' => 247,
|
||||
'ros' => 248,
|
||||
'sw' => 249,
|
||||
'vms' => 250,
|
||||
'vmd' => 251,
|
||||
'xtel' => 252,
|
||||
'xyz' => 253,
|
||||
'gif' => 254,
|
||||
'ief' => 255,
|
||||
'jpeg' => 256,
|
||||
'jpe' => 256,
|
||||
'jpg' => 256,
|
||||
'pcx' => 257,
|
||||
'png' => 258,
|
||||
'svgz' => 259,
|
||||
'svg' => 259,
|
||||
'tif' => 260,
|
||||
'tiff' => 260,
|
||||
'djvu' => 261,
|
||||
'djv' => 261,
|
||||
'ico' => 262,
|
||||
'wbmp' => 263,
|
||||
'ras' => 264,
|
||||
'cdr' => 265,
|
||||
'pat' => 266,
|
||||
'cdt' => 267,
|
||||
'cpt' => 268,
|
||||
'art' => 269,
|
||||
'jng' => 270,
|
||||
'bmp' => 271,
|
||||
'psd' => 272,
|
||||
'pnm' => 273,
|
||||
'pbm' => 274,
|
||||
'pgm' => 275,
|
||||
'ppm' => 276,
|
||||
'rgb' => 277,
|
||||
'xbm' => 278,
|
||||
'xpm' => 279,
|
||||
'xwd' => 280,
|
||||
'eml' => 281,
|
||||
'igs' => 282,
|
||||
'iges' => 282,
|
||||
'silo' => 283,
|
||||
'msh' => 283,
|
||||
'mesh' => 283,
|
||||
'icz' => 285,
|
||||
'ics' => 285,
|
||||
'css' => 286,
|
||||
'csv' => 287,
|
||||
'323' => 288,
|
||||
'html' => 289,
|
||||
'htm' => 289,
|
||||
'shtml' => 289,
|
||||
'uls' => 290,
|
||||
'mml' => 291,
|
||||
'txt' => 292,
|
||||
'pot' => 292,
|
||||
'text' => 292,
|
||||
'asc' => 292,
|
||||
'rtx' => 293,
|
||||
'wsc' => 294,
|
||||
'sct' => 294,
|
||||
'tsv' => 295,
|
||||
'ts' => 296,
|
||||
'tm' => 296,
|
||||
'jad' => 297,
|
||||
'wml' => 298,
|
||||
'wmls' => 299,
|
||||
'bib' => 300,
|
||||
'boo' => 301,
|
||||
'hpp' => 302,
|
||||
'hh' => 302,
|
||||
'h++' => 302,
|
||||
'hxx' => 302,
|
||||
'cxx' => 303,
|
||||
'cc' => 303,
|
||||
'cpp' => 303,
|
||||
'c++' => 303,
|
||||
'h' => 304,
|
||||
'htc' => 305,
|
||||
'csh' => 306,
|
||||
'c' => 307,
|
||||
'patch' => 308,
|
||||
'diff' => 308,
|
||||
'd' => 309,
|
||||
'hs' => 310,
|
||||
'java' => 311,
|
||||
'lhs' => 312,
|
||||
'moc' => 313,
|
||||
'pas' => 314,
|
||||
'p' => 314,
|
||||
'gcd' => 315,
|
||||
'pm' => 316,
|
||||
'pl' => 316,
|
||||
'py' => 317,
|
||||
'etx' => 318,
|
||||
'sh' => 319,
|
||||
'tk' => 320,
|
||||
'tcl' => 320,
|
||||
'cls' => 321,
|
||||
'ltx' => 321,
|
||||
'sty' => 321,
|
||||
'tex' => 321,
|
||||
'vcs' => 322,
|
||||
'vcf' => 323,
|
||||
'3gp' => 324,
|
||||
'dl' => 325,
|
||||
'dif' => 326,
|
||||
'dv' => 326,
|
||||
'fli' => 327,
|
||||
'gl' => 328,
|
||||
'mp4' => 329,
|
||||
'mpe' => 330,
|
||||
'mpeg' => 330,
|
||||
'mpg' => 330,
|
||||
'ogv' => 331,
|
||||
'qt' => 332,
|
||||
'mov' => 332,
|
||||
'mxu' => 333,
|
||||
'lsf' => 334,
|
||||
'lsx' => 334,
|
||||
'mng' => 335,
|
||||
'asx' => 336,
|
||||
'asf' => 336,
|
||||
'wm' => 337,
|
||||
'wmv' => 338,
|
||||
'wmx' => 339,
|
||||
'wvx' => 340,
|
||||
'avi' => 341,
|
||||
'movie' => 342,
|
||||
'ice' => 343,
|
||||
'sisx' => 344,
|
||||
'wrl' => 345,
|
||||
'vrm' => 345,
|
||||
'vrml' => 345,
|
||||
),
|
||||
);
|
||||
}
|
|
@ -1997,3 +1997,37 @@ class FileNameMungingTest extends FileTestCase {
|
|||
// $this->assertIdentical($unmunged_name, $this->name, t('The unmunged (%unmunged) filename matches the original (%original)', array('%unmunged' => $unmunged_name, '%original' => $this->name)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for file_get_mimetype().
|
||||
*/
|
||||
class FileMimeTypeTest extends DrupalWebTestCase {
|
||||
public static function getInfo() {
|
||||
return array(
|
||||
'name' => t('File mimetypes'),
|
||||
'description' => t('Test filename mimetype detection.'),
|
||||
'group' => t('File'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test basic extraction of mimetypes from the filename.
|
||||
*/
|
||||
public function testFileMimeTypeDetection() {
|
||||
$test_case = array(
|
||||
'test.jar' => 'application/java-archive',
|
||||
'test.jpeg' => 'image/jpeg',
|
||||
'test.jpg' => 'image/jpeg',
|
||||
'test.jar.jpg' => 'image/jpeg',
|
||||
'test.jpg.jar' => 'application/java-archive',
|
||||
'test.pcf.Z' => 'application/x-font',
|
||||
'pcf.Z' => 'application/octet-stream',
|
||||
'jar' => 'application/octet-stream',
|
||||
);
|
||||
|
||||
foreach ($test_case as $input => $expected) {
|
||||
$output = file_get_mimetype($input);
|
||||
$this->assertIdentical($output, $expected, t('Mimetype for %input is %output (expected: %expected).', array('%input' => $input, '%output' => $output, '%expected' => $expected)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue