From 2b109a6dc4b66b7737e526b995eb767cb101625e Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Wed, 22 Nov 2006 00:25:57 +0000 Subject: [PATCH] (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. --- RELEASE-NOTES | 6 ++++-- includes/ImagePage.php | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) 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(); -- 2.20.1