r79835 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79834‎ | r79835 | r79836 >
Date:19:41, 7 January 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
Document how the mime<->extension map is supposed to work, to my best understanding from reading the code. Fixed the built-in mini-mime.types according to this specification. Should fix bug 26367.
Modified paths:
  • /trunk/phase3/includes/MimeMagic.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MimeMagic.php
@@ -10,6 +10,19 @@
1111 * This is used as a fallback to mime.types files.
1212 * An extensive list of well known mime types is provided by
1313 * the file mime.types in the includes directory.
 14+ *
 15+ * This list concatenated with mime.types is used to create a mime <-> ext
 16+ * map. Each line contains a mime type followed by a space separated list of
 17+ * extensions. If multiple extensions for a single mime type exist or if
 18+ * multiple mime types exist for a single extension then in most cases
 19+ * MediaWiki assumes that the first extension following the mime type is the
 20+ * canonical extension, and the first time a mime type appears for a certain
 21+ * extension is considered the canonical mime type.
 22+ *
 23+ * (Note that appending $wgMimeTypeFile to the end of MM_WELL_KNOWN_MIME_TYPES
 24+ * sucks because you can't redefine canonical types. This could be fixed by
 25+ * appending MM_WELL_KNOWN_MIME_TYPES behind $wgMimeTypeFile, but who knows
 26+ * what will break? In practice this probably isn't a problem anyway -- Bryan)
1427 */
1528 define('MM_WELL_KNOWN_MIME_TYPES',<<<END_STRING
1629 application/ogg ogx ogg ogm ogv oga spx
@@ -41,9 +54,12 @@
4255 image/gif gif
4356 image/jpeg jpeg jpg jpe
4457 image/png png
45 -image/svg+xml image/svg svg
 58+image/svg+xml svg
 59+image/svg svg
4660 image/tiff tiff tif
47 -image/vnd.djvu image/x.djvu image/x-djvu djvu
 61+image/vnd.djvu djvu
 62+image/x.djvu djvu
 63+image/x-djvu djvu
4864 image/x-portable-pixmap ppm
4965 image/x-xcf xcf
5066 text/plain txt

Follow-up revisions

RevisionCommit summaryAuthorDate
r799171.17: MFT r78554, r79166, r79702, r79746, r79812, r79835, r79838, r79846, r79...catrope21:07, 9 January 2011

Comments

#Comment by TheDJ (talk | contribs)   13:45, 9 January 2011

Yikes, that's a bad bug there. I can't believe i didn't spot this when I last added something to that list.

Status & tagging log