(bug 7554) The correct MIME type for SVG images is now displayed on the image page...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 22 Nov 2006 00:25:57 +0000 (00:25 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Wed, 22 Nov 2006 00:25:57 +0000 (00:25 +0000)
RELEASE-NOTES
includes/ImagePage.php

index cd2f9b6..564e2f5 100644 (file)
@@ -203,9 +203,11 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 7970) Use current connection explicitly on Database::getServerVersion
 * (bug 2001) Tables with class="sortable" can now be dynamically sorted via
   JavaScript.
-* Added autosummary for new pages with 500 or less characters, and refactor 
-   the autosummary code so it's all done in one function. doEdit is getting too 
+* Added autosummary for new pages with 500 or less characters, and refactor
+   the autosummary code so it's all done in one function. doEdit is getting too
    big!
+* (bug 7554) The correct MIME type for SVG images is now displayed on the
+  image page (image/svg+xml, not image/svg).
 
 
 == Languages updated ==
index 86a1500..102ae49 100644 (file)
@@ -300,9 +300,15 @@ class ImagePage extends Article {
 
                        if ($showLink) {
                                $filename = wfEscapeWikiText( $this->img->getName() );
+                               // Hacky workaround: for some reason we use the incorrect MIME type
+                               // image/svg for SVG.  This should be fixed internally, but at least
+                               // make the displayed type right.
+                               $mime = $this->img->getMimeType();
+                               if ($mime == 'image/svg') $mime = 'image/svg+xml';
+
                                $info = wfMsg( 'fileinfo',
                                        ceil($this->img->getSize()/1024.0),
-                                       $this->img->getMimeType() );
+                                       $mime );
 
                                global $wgContLang;
                                $dirmark = $wgContLang->getDirMark();