r36895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36894‎ | r36895 | r36896 >
Date:10:33, 2 July 2008
Author:aaron
Status:old
Tags:
Comment:
Append subtitle to keep existing stuff for redirects (bug 14696)
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -861,7 +861,7 @@
862862 }
863863
864864 elseif ( $rt = Title::newFromRedirect( $text ) ) {
865 - # Don't overwrite the subtitle if this was an old revision
 865+ # Don't append the subtitle if this was an old revision
866866 $this->viewRedirect( $rt, !$wasRedirected && $this->isCurrent() );
867867 $parseout = $wgParser->parse($text, $this->mTitle, ParserOptions::newFromUser($wgUser));
868868 $wgOut->addParserOutputNoText( $parseout );
@@ -925,15 +925,15 @@
926926 wfProfileOut( __METHOD__ );
927927 }
928928
929 - protected function viewRedirect( $target, $overwriteSubtitle = true, $forceKnown = false ) {
 929+ protected function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) {
930930 global $wgParser, $wgOut, $wgContLang, $wgStylePath, $wgUser;
931931
932932 # Display redirect
933933 $imageDir = $wgContLang->isRTL() ? 'rtl' : 'ltr';
934934 $imageUrl = $wgStylePath.'/common/images/redirect' . $imageDir . '.png';
935935
936 - if( $overwriteSubtitle ) {
937 - $wgOut->setSubtitle( wfMsgHtml( 'redirectpagesub' ) );
 936+ if( $appendSubtitle ) {
 937+ $wgOut->appendSubtitle( wfMsgHtml( 'redirectpagesub' ) );
938938 }
939939 $sk = $wgUser->getSkin();
940940 if ( $forceKnown )
Index: trunk/phase3/includes/ImagePage.php
@@ -67,7 +67,7 @@
6868 // probably the redirect page itself. Fake the redirect symbol
6969 $wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
7070 $this->viewRedirect( Title::makeTitle( NS_IMAGE, $this->img->getName() ),
71 - /* $overwriteSubtitle */ true, /* $forceKnown */ true );
 71+ /* $appendSubtitle */ true, /* $forceKnown */ true );
7272 $this->viewUpdates();
7373 return;
7474 }

Status & tagging log