From f2b9274bce47afabb468d24e021820f318fbde68 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 12 Aug 2005 04:44:43 +0000 Subject: [PATCH] * (bug 3117) Fix display of upload size and type with tidy on. Wikitext blocks should never be inserted in the middle of a line, they are expected to be block elements! --- RELEASE-NOTES | 1 + includes/ImagePage.php | 45 +++++++++++++++++++----------------------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 321e2fe9b6..3b4169faa5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -16,6 +16,7 @@ Misc work going on..... * (bug 3056) MySQL 3 compatibility fix: USE INDEX instead of FORCE INDEX * PHP 4.1 compatibility fix: don't use new_link parameter to mysql_connect if running prior to 4.2.0 as it causes the call to fail +* (bug 3117) Fix display of upload size and type with tidy on === Caveats === diff --git a/includes/ImagePage.php b/includes/ImagePage.php index f3ead557c1..f7aec17176 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -206,34 +206,29 @@ class ImagePage extends Article { if ($showLink) { - $s= $sk->makeMediaLink( $this->img->getName(), '', '', true ); - $info= wfMsg( 'fileinfo', ceil($this->img->getSize()/1024.0), $this->img->getMimeType() ); + $filename = wfEscapeWikiText( $this->img->getName() ); + $info = wfMsg( 'fileinfo', + ceil($this->img->getSize()/1024.0), + $this->img->getMimeType() ); if (!$this->img->isSafeFile()) { - $wgOut->addHTML("
"); - $wgOut->addHTML(""); - $wgOut->addHTML($s); - $wgOut->addHTML(""); - - $wgOut->addHTML(" ("); - $wgOut->addWikiText( $info, false ); - $wgOut->addHTML(")"); - $wgOut->addHTML("
"); - - #this should be formated a little nicer. Is CSS sufficient? - $wgOut->addHTML("
"); - $wgOut->addWikiText( wfMsg( 'mediawarning' ) ); - $wgOut->addHTML('
'); - + $warning = wfMsg( 'mediawarning' ); + $wgOut->addWikiText( << +[[Media:$filename|$filename]] + ($info) + + +
$warning
+END + ); } else { - $wgOut->addHTML("
"); - $wgOut->addHTML($s); - - $wgOut->addHTML(" ("); - $wgOut->addWikiText( $info, false ); - $wgOut->addHTML(")"); - - $wgOut->addHTML("
"); + $wgOut->addWikiText( << +[[Media:$filename|$filename]] ($info) + +END + ); } } -- 2.20.1