Use context when parsing message 'redirectedfrom'
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 28 Jan 2015 18:02:42 +0000 (19:02 +0100)
committerUmherirrender <umherirrender_de.wp@web.de>
Thu, 29 Jan 2015 18:43:03 +0000 (18:43 +0000)
Avoids:
MessageCache::parse called [...] with no title set

Change-Id: Ib320da1081690bd21bdf9d0ef8d279c97fb42c9a

includes/page/Article.php

index 6516ae8..294c04e 100644 (file)
@@ -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( "<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
@@ -1010,7 +1011,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