From: umherirrender Date: Wed, 28 Jan 2015 18:02:42 +0000 (+0100) Subject: Use context when parsing message 'redirectedfrom' X-Git-Tag: 1.31.0-rc.0~12316^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=93e4633ec6ee3e0b6701a1ebaecf5789554cac49;p=lhc%2Fweb%2Fwiklou.git Use context when parsing message 'redirectedfrom' Avoids: MessageCache::parse called [...] with no title set Change-Id: Ib320da1081690bd21bdf9d0ef8d279c97fb42c9a --- diff --git a/includes/page/Article.php b/includes/page/Article.php index 6516ae81d2..294c04e2d4 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -959,9 +959,10 @@ class Article implements Page { */ public function showRedirectedFromHeader() { global $wgRedirectSources; - $outputPage = $this->getContext()->getOutput(); - $request = $this->getContext()->getRequest(); + $context = $this->getContext(); + $outputPage = $context->getOutput(); + $request = $context->getRequest(); $rdfrom = $request->getVal( 'rdfrom' ); // Construct a URL for the current page view, but with the target title @@ -986,7 +987,7 @@ class Article implements Page { ); $outputPage->addSubtitle( "" . - wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse() + $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse() . "" ); // Add the script to update the displayed URL and @@ -1010,7 +1011,7 @@ class Article implements Page { if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) { $redir = Linker::makeExternalLink( $rdfrom, $rdfrom ); $outputPage->addSubtitle( "" . - wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse() + $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse() . "" ); // Add the script to update the displayed URL