r21724 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21723‎ | r21724 | r21725 >
Date:17:41, 30 April 2007
Author:brion
Status:old
Tags:
Comment:
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 "<small>" 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
Modified paths:
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -224,12 +224,13 @@
225225 # Note that $height <= $maxHeight now, but might not be identical
226226 # because of rounding.
227227 }
228 - $msgbig = wfMsgHtml('show-big-image');
229 - $msgsmall = wfMsg('show-big-image-thumb', $width, $height );
 228+ $msgbig = wfMsgHtml( 'show-big-image' );
 229+ $msgsmall = wfMsgExt( 'show-big-image-thumb',
 230+ array( 'parseinline' ), $width, $height );
230231 } else {
231232 # Image is small enough to show full size on image page
232 - $msgbig = $this->img->getName();
233 - $msgsmall = wfMsg( 'file-nohires' );
 233+ $msgbig = htmlspecialchars( $this->img->getName() );
 234+ $msgsmall = wfMsgExt( 'file-nohires', array( 'parseinline' ) );
234235 }
235236
236237 $params['width'] = $width;