From: Kunal Mehta Date: Thu, 4 Dec 2014 22:06:55 +0000 (-0800) Subject: thumb.php: Set proper output formats for messages going into HTML X-Git-Tag: 1.31.0-rc.0~12935 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=a8c2cda23145da37718cf6588c58465422d5ba54;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/thumb.php b/thumb.php index 3d8612d972..6c935c14f4 100644 --- a/thumb.php +++ b/thumb.php @@ -135,12 +135,12 @@ function wfStreamThumb( array $params ) { // Format is ! $bits = explode( '!', $fileName, 2 ); if ( count( $bits ) != 2 ) { - wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); + wfThumbError( 404, wfMessage( 'badtitletext' )->parse() ); return; } $title = Title::makeTitleSafe( NS_FILE, $bits[1] ); if ( !$title ) { - wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); + wfThumbError( 404, wfMessage( 'badtitletext' )->parse() ); return; } $img = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $title, $fileName ); @@ -150,7 +150,7 @@ function wfStreamThumb( array $params ) { // Check the source file title if ( !$img ) { - wfThumbError( 404, wfMessage( 'badtitletext' )->text() ); + wfThumbError( 404, wfMessage( 'badtitletext' )->parse() ); return; } @@ -310,10 +310,10 @@ function wfStreamThumb( array $params ) { $user = RequestContext::getMain()->getUser(); if ( !wfThumbIsStandard( $img, $params ) && $user->pingLimiter( 'renderfile-nonstandard' ) ) { - wfThumbError( 500, wfMessage( 'actionthrottledtext' ) ); + wfThumbError( 500, wfMessage( 'actionthrottledtext' )->parse() ); return; } elseif ( $user->pingLimiter( 'renderfile' ) ) { - wfThumbError( 500, wfMessage( 'actionthrottledtext' ) ); + wfThumbError( 500, wfMessage( 'actionthrottledtext' )->parse() ); return; } @@ -598,7 +598,7 @@ function wfExtractThumbParams( $file, $params ) { * Output a thumbnail generation error message * * @param int $status - * @param string $msg + * @param string $msg HTML * @return void */ function wfThumbError( $status, $msg ) {