From: Aryeh Gregor Date: Wed, 22 Nov 2006 00:25:57 +0000 (+0000) Subject: (bug 7554) The correct MIME type for SVG images is now displayed on the image page... X-Git-Tag: 1.31.0-rc.0~55126 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=2b109a6dc4b66b7737e526b995eb767cb101625e;p=lhc%2Fweb%2Fwiklou.git (bug 7554) The correct MIME type for SVG images is now displayed on the image page (image/svg+xml, not image/svg). This is a hack because it only affects display, and doesn't correct the internal storage. I don't know how the latter works, so I wasn't confident touching it. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cd2f9b6f2f..564e2f571c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 86a15008fb..102ae49ea3 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -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();