aboutsummaryrefslogtreecommitdiffstats
path: root/includes/mime.info
Commit message (Collapse)AuthorAgeFilesLines
* Move MimeMagic code to libs/mime/MimeAnalyzer.phpAaron Schulz2016-10-151-119/+0
| | | | | | | | | | | * The later resides in /libs with related files. * Explose MimeAnalyzer as a service. * Keep MimeMagic::singleton() as a b/c alias. * MimeMagic::applyDefaultConfig() will bootstrap the service with all of the old config, extension hook handler, and detector command shell-out behavior. Change-Id: Ie2695a52e7a3bcfda9f7fa83659a9ff31b372bc3
* MimeMagic: Set mime-type for .js to application/javascriptTimo Tijhof2016-01-261-1/+1
| | | | | | | | | | | | | | | | | | | The previous "application/x-javascript" was non-standard. It was used as unregistered mime type by various vendors after stakeholders agreed it shouldn't be text/javascript anymore, but "application/javascript" was still pending approval. That was settled in 2006 with RFC 4329. http://www.iana.org/assignments/media-types/media-types.xhtml https://tools.ietf.org/html/rfc4329 It also previously inconsistently returned "application/x-javascript" or "text/javascript" depending on whether you call MimeMagic with or without the flag that asks for "improved" mime magic (in the latter mode, it picks the first one from the mime-info list as override). This makes MimeMagic match the behaviour of HHVM-static server, NGINX, and Apache 2.4; with regards to Content-Type for .js files. Change-Id: Idfe0a80c60c548fe28283c62ee9803bff7bdb2d6
* adding 7zip archives to the MIMEsdennisroczek2015-10-141-1/+1
| | | | Change-Id: Ib3392b7fcec475c153099a1b92fe195c5eb4b195
* Add image/pjpeg as an alias for image/jpegBrian Wolff2015-06-111-1/+1
| | | | | | | | | | image/pjpeg is a non-standard mime type for progressive jpegs that is sometimes used. Not considering this an alias of normal jpeg images was causing content type validation failures in gwtoolset. Bug: T102136 Change-Id: I505f16c4e8e4ee2e2a4675f4f07c4b8c12f9d187
* mime.types: allow bzip2 uploadDPStokesNZ2015-03-161-0/+1
| | | | | | Update to allow upload of application/x-bzip2 .bz2 files. Change-Id: I84158423de755d45d85b1bc34e49f58f8725f5cd
* Make image/vnd.microsoft.icon be an alias for image/x-icon mime type.Alexia E. Smith2014-09-131-1/+1
| | | | | | | | The mime type .ico files is detected as image/vnd.microsoft.icon on some PHP installations. This fixes the issue by aliasing it to image/x-icon. Bug: 69437 Change-Id: I1fdb4c7058546d6cdd47b1961706ef84a05dd360
* Unify the spelling of MIME in documentationrillke2014-08-071-2/+2
| | | | | | Writing MIME as written in Wikipedia and some documentation clean up. Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4
* Merge "Fix mime detection of easily-confused-with text/plain formats"jenkins-bot2014-07-041-0/+3
|\
| * Fix mime detection of easily-confused-with text/plain formatsBrian Wolff2014-07-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | json, csv, and tsv are often detected as text/plain. However that's not right. This patch causes MediaWiki to look at the file extension of files detected as text/plain, and if the file extension is for a "textual" type, use the mime type associated with that extension. This change also changes the "does mime type match uploaded file extension" check to use the mime based on the file contents plus extension, as opposed to just the file contents. Various documentation suggests this is more appropriate (e.g. line 807 of MimeMagic.php). In my opinion we should use just the file contents when verifying file is not on blacklist, but use ext when verifying file type matches extension, and for decided what handler specific checks to run. Not the detect mime type with extension doesn't override the detected mime type with the extension, but only uses the extension if content based detection is ambigious or not specific enough. This patch should be reviewed by csteipp before merge for any potential security implications. Note: This is partially fixing a regression from 3846d1048766a7, where previously csv and json files were allowed to be uploaded, and that change prevented them Bug: 66036 Bug: 45424 Change-Id: Ib637fe6850a81b26f84dc8c00ab4772f3d3a1f34
* | Detect chemical table files: Add them to MIME listingsrillke2014-07-041-0/+5
|/ | | | | | | | | | | | | Adding mol, sdf, rxn, rd and rg file types to mime.types and mime.info map to make them known to MediaWiki by default. PHP's own module fileinfo module is not capable detecting Chemical table files. Instead, they are reported as text/plain. MediaHandlers can be attached by MIME type only. That's why these changes are required for [[Extension:MolHandler]] to work. Change-Id: I017507e4a950b3ce4e6576d12217cd42a337bad6
* Add flac to mime.types and mime.infoBrian Wolff2013-08-231-0/+2
| | | | | | | | | Any format we allow uploading should be in these files. We detect flac as audio/x-flac, but adding audio/flac too, to be safe. Change-Id: I564ff895cd0a6d4c6cd25bb565329b17a6771852
* Add MP4 to mime.typesBrian Wolff2013-08-191-0/+2
| | | | | | | | | | | | | Its a popular video format, we should recognize its type. This will also prevent people from uploading mp4's to commons. Wikipedia claims m4a sometimes used for video content. RFC 4337 says audio/mp4 is mime type for mp4 with no video (which is usually what an m4a extension means). Bug: 52990 Change-Id: I5c24c3e318651241cced5b36d107d3603a289427
* Follow-up r104312, tab to spaceBryan Tong Minh2011-11-261-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104313
* (bug 32630) Add image/vnd.adobe.photoshop as alias for image/x-photoshopBryan Tong Minh2011-11-261-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104312
* Merged Wikia change.Sean Colombo2011-09-141-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/97030
* Per CR, revert non debugging stuff from r82436. (KML uploads)Bryan Tong Minh2011-06-291-2/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91109
* (bug 18803) JPEG2000 images can no longer be uploaded as JPEG image. Done by ↵Bryan Tong Minh2011-05-141-0/+1
| | | | | | | adding the relevant mime info to mime.types and mime.info Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88086
* Revert r82922 (adding eml files to mime types). Per CR, these should be ↵Chad Horohoe2011-04-161-1/+0
| | | | | | | accompanied by appropriate sanity checks on upload Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/86161
* Add mime type/info for .eml filesMark A. Hershberger2011-02-281-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82922
* Bug #26059 — Add support for KML/KMZ filetypeMark A. Hershberger2011-02-191-2/+2
| | | | | | | | | | | | | | | Patch from Derk-Jan Hartman of which he writes: I figured adding kml support would be a breeze, but I had not counted on the brain dead browser that is IE6. Unfortunately, kml contains the element <heading, which triggers the protection in detectScript() that protects from uploads that IE6 might mistake for HTML. It triggers on "<head" not sure if we can work around this, but Tim will know. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82436
* re bug #25523: add mime.info and mime.types for *.dwg files so that when ↵Mark A. Hershberger2011-02-181-0/+2
| | | | | | | people add dwg to $wgFileExtensions, they can move files. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/82418
* Add support to upload WebP files. Disabled by default and no thumbnailing ↵Derk-Jan Hartman2010-10-201-0/+1
| | | | | | | | | support. Relates to bug 25397 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75087
* Recognize webm and matroska files. See also Bug 23888Derk-Jan Hartman2010-07-281-0/+4
| | | | | | | | | | | | | Currently all webm files are stored as video/webm. It is not possible to detect wether this file is an audio file without using a full parser. This is why We should really move mime and mediatype accessors to the MediaHandlers. Using video/x-matroska for MKV files. There is no official mime for MKV (though the webm isn't official either, but everyone is already using it apparently). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70103
* Bug 23642. Best effort mime detection for OpenXML filesDerk-Jan Hartman2010-06-191-0/+20
| | | | | | | | | OpenXML files are Open Package Convention files. Internally, we use the custom mime application/x-opc+zip for these files. In the database, we store the 'proper' mime, which we gu ess from the file extension, or if not supported, application/zip. All OPC files are blacklisted by $wgMimeTypeBlacklist by default, just as other zip files. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/68279
* * (bug 23422) mp3 files can now be movedAlexandre Emsenhuber2010-05-081-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66069
* (bug 23375) Added ogv, oga, spx as extensions for ogg files. Patch by ↵Bryan Tong Minh2010-05-021-0/+1
| | | | | | | Derk-Jan Hartman. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/65816
* (bug 22935) image/x-ms-bmp mime type added for BMP filesChad Horohoe2010-04-011-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/64509
* Also adding application/x-dia-diagram to mime.{types,info}Leon Weber2008-04-271-6/+7
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/33935
* * remove end of line whitespaceSiebrand Mazeland2008-04-141-2/+2
| | | | | | | | * remove empty lines at end of file * remove "?>" where still present Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/33276
* added mime type aliases for djvuDaniel Kinzler2007-09-281-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/26228
* * Introduced media handler modules for file-type specific operations: ↵Tim Starling2007-04-201-1/+1
| | | | | | | | | | | | | | | | | | | thumbnailing, img_metadata, capabilities, etc. * Deprecated $wgUseImageResize, thumbnailing will be enabled unconditionally. * Fixed interaction of page parameter to ImagePage with the HTML file cache * Improved error reporting for image thumbnailing * Fixed MIME type for SVG files, will be silently changed from image/svg to image/svg+xml after loading from the database. * Workaround for djvutoxml bug #1704049 (poor performance). Use djvudump instead. * Fixed odd behaviour in ImagePage on DjVu thumbnailing errors * Improved error reporting for image thumbnailing * Added sharpening option for ImageMagick thumbnailing * Removed Image::selectPage(), added page parameters to getWidth() and getHeight(), deprecated Image::renderThumb() and Image::getThumbnail() * Changed default contents of img_metadata to empty string instead of a:0:{} * Moved responsibility for respecting $wgGenerateThumbnailOnParse from the UI to Image.php Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/21411
* added image/x-png as an alias for image/pngDaniel Kinzler2007-03-021-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/20115
* added mime type for FLV filesDaniel Kinzler2007-02-281-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/20083
* * (bug 5277) Use audio/midi rather that audio/midBrion Vibber2006-03-301-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/13397
* * (bug 898) Mime type autodetection.Ævar Arnfjörð Bjarmason2005-05-211-0/+76
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/9116