From 93e4633ec6ee3e0b6701a1ebaecf5789554cac49 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 28 Jan 2015 19:02:42 +0100 Subject: [PATCH] Use context when parsing message 'redirectedfrom' Avoids: MessageCache::parse called [...] with no title set Change-Id: Ib320da1081690bd21bdf9d0ef8d279c97fb42c9a --- includes/page/Article.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 -- 2.20.1