Merge "Use context when parsing message 'redirectedfrom'"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 22 Feb 2015 00:21:44 +0000 (00:21 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 22 Feb 2015 00:21:44 +0000 (00:21 +0000)
includes/page/Article.php

index a624e48..cf275f4 100644 (file)
@@ -958,9 +958,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
@@ -985,7 +986,7 @@ class Article implements Page {
                                );
 
                                $outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
-                                       wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
+                                       $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse()
                                . "</span>" );
 
                                // Add the script to update the displayed URL and
@@ -1009,7 +1010,7 @@ class Article implements Page {
                        if ( $wgRedirectSources && preg_match( $wgRedirectSources, $rdfrom ) ) {
                                $redir = Linker::makeExternalLink( $rdfrom, $rdfrom );
                                $outputPage->addSubtitle( "<span class=\"mw-redirectedfrom\">" .
-                                       wfMessage( 'redirectedfrom' )->rawParams( $redir )->parse()
+                                       $context->msg( 'redirectedfrom' )->rawParams( $redir )->parse()
                                . "</span>" );
 
                                // Add the script to update the displayed URL