Append subtitle to keep existing stuff for redirects (bug 14696)
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 2 Jul 2008 10:33:42 +0000 (10:33 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 2 Jul 2008 10:33:42 +0000 (10:33 +0000)
includes/Article.php
includes/ImagePage.php

index 2ce6905..44693f8 100644 (file)
@@ -861,7 +861,7 @@ class Article {
                        }
 
                        elseif ( $rt = Title::newFromRedirect( $text ) ) {
-                               # Don't overwrite the subtitle if this was an old revision
+                               # Don't append the subtitle if this was an old revision
                                $this->viewRedirect( $rt, !$wasRedirected && $this->isCurrent() );
                                $parseout = $wgParser->parse($text, $this->mTitle, ParserOptions::newFromUser($wgUser));
                                $wgOut->addParserOutputNoText( $parseout );
@@ -925,15 +925,15 @@ class Article {
                wfProfileOut( __METHOD__ );
        }
        
-       protected function viewRedirect( $target, $overwriteSubtitle = true, $forceKnown = false ) {
+       protected function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
                global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser;
                
                # Display redirect
                $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
                $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
                
-               if( $overwriteSubtitle ) {
-                       $wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) );
+               if( $appendSubtitle ) {
+                       $wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
                }
                $sk = $wgUser->getSkin();
                if ( $forceKnown )
index 5d4db92..30fcf13 100644 (file)
@@ -67,7 +67,7 @@ class ImagePage extends Article {
                                // probably the redirect page itself. Fake the redirect symbol
                                $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
                                $this->viewRedirect( Title::makeTitle( NS_IMAGE, $this->img->getName() ),
-                                       /* $overwriteSubtitle */ true, /* $forceKnown */ true );
+                                       /* $appendSubtitle */ true, /* $forceKnown */ true );
                                $this->viewUpdates();
                                return;
                        }