From f83d881fb16025437543141f5ef396c0ea3e7e19 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 30 Apr 2007 17:41:12 +0000 Subject: [PATCH] Normalize escaping for some image page messages: * HTML-escape the image filename when made into an original-size link for HTML purity * Use inline wiki parsing instead of raw HTML for show-big-image-thumb and file-nohires messages. This is cleaner (less raw HTML yay) while avoiding breaking the "" tags which are for some reason in the defaults and likely any customizations (sigh) and will allow the pixel values to have localized number formatting if appropriate parser function is used --- includes/ImagePage.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 84863d8b6e..e593082ecc 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -224,12 +224,13 @@ class ImagePage extends Article { # Note that $height <= $maxHeight now, but might not be identical # because of rounding. } - $msgbig = wfMsgHtml('show-big-image'); - $msgsmall = wfMsg('show-big-image-thumb', $width, $height ); + $msgbig = wfMsgHtml( 'show-big-image' ); + $msgsmall = wfMsgExt( 'show-big-image-thumb', + array( 'parseinline' ), $width, $height ); } else { # Image is small enough to show full size on image page - $msgbig = $this->img->getName(); - $msgsmall = wfMsg( 'file-nohires' ); + $msgbig = htmlspecialchars( $this->img->getName() ); + $msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) ); } $params['width'] = $width; -- 2.20.1