Page MenuHomePhabricator

bugT76686-REL1_22.patch

Authored By
Mglaser
Dec 15 2014, 2:38 PM
Size
2 KB
Referenced Files
None
Subscribers
None

bugT76686-REL1_22.patch

From 6fe5ecf7f7019ad1feaf8852ddc4896f416dcbb1 Mon Sep 17 00:00:00 2001
From: Kunal Mehta <legoktm@gmail.com>
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 | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/thumb.php b/thumb.php
index 913adc1..dc3093c 100644
--- a/thumb.php
+++ b/thumb.php
@@ -131,12 +131,12 @@ function wfStreamThumb( array $params ) {
// Format is <timestamp>!<name>
$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 );
@@ -146,7 +146,7 @@ function wfStreamThumb( array $params ) {
// Check the source file title
if ( !$img ) {
- wfThumbError( 404, wfMessage( 'badtitletext' )->text() );
+ wfThumbError( 404, wfMessage( 'badtitletext' )->parse() );
return;
}
@@ -306,7 +306,7 @@ function wfStreamThumb( array $params ) {
$user = RequestContext::getMain()->getUser();
if ( $user->pingLimiter( 'renderfile' ) ) {
- wfThumbError( 500, wfMessage( 'actionthrottledtext' ) );
+ wfThumbError( 500, wfMessage( 'actionthrottledtext' )->parse() );
return;
}
@@ -452,7 +452,7 @@ function wfExtractThumbParams( $file, $params ) {
* 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

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
20394
Default Alt Text
bugT76686-REL1_22.patch (2 KB)

Event Timeline