From a4631f17cabf3c4ccd540c0c4da2cba2ec716202 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Thu, 4 Dec 2014 14:06:55 -0800 Subject: [PATCH] thumb.php: Set proper output formats for messages going into HTML * Use ->parse() instead of ->text() for wikitext messages that were being treated as HTML * Explicitly specify ->parse() if no output format was set * Document that wfThumbError() takes HTML Bug: T76686 Change-Id: Id6e7548b2e081cfda7803772ed0395a15feb1f84 --- thumb.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/thumb.php b/thumb.php index 60a7ffb..a7a09fc 100644 --- a/thumb.php +++ b/thumb.php @@ -107,13 +107,13 @@ function wfStreamThumb( array $params ) { // Format is ! $bits = explode( '!', $fileName, 2 ); if ( count( $bits ) != 2 ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->parse() ); wfProfileOut( __METHOD__ ); return; } $title = Title::makeTitleSafe( NS_FILE, $bits[1] ); if ( !$title ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->parse() ); wfProfileOut( __METHOD__ ); return; } @@ -136,7 +136,7 @@ function wfStreamThumb( array $params ) { // Check the source file storage path if ( !$img ) { - wfThumbError( 404, wfMsg( 'badtitletext' ) ); + wfThumbError( 404, wfMessage( 'badtitletext' )->parse() ); wfProfileOut( __METHOD__ ); return; } @@ -291,7 +291,7 @@ function wfExtractThumbParams( $uri ) { * Output a thumbnail generation error message * * @param $status integer - * @param $msg string + * @param string $msg HTML * @return void */ function wfThumbError( $status, $msg ) { -- 1.9.2.msysgit.0