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)
1  2 
includes/page/Article.php

@@@ -756,8 -756,9 +756,8 @@@ class Article implements Page 
         * Show a diff page according to current request variables. For use within
         * Article::view() only, other callers should use the DifferenceEngine class.
         *
 -       * @todo Make protected
         */
 -      public function showDiffPage() {
 +      protected function showDiffPage() {
                $request = $this->getContext()->getRequest();
                $user = $this->getContext()->getUser();
                $diff = $request->getVal( 'diff' );
         */
        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
                                );
  
                                $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
                        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
                                ( $forceKnown ? array( 'known', 'noclasses' ) : array() )
                        ) . '</li>';
                }
 +              $html .= '</ul>';
  
 -              $redirectToText = wfMessage( 'redirectto' )->inLanguage( $lang )->text();
 +              $redirectToText = wfMessage( 'redirectto' )->inLanguage( $lang )->escaped();
  
                return '<div class="redirectMsg">' .
                        '<p>' . $redirectToText . '</p>' .