Append subtitle to keep existing stuff for redirects (bug 14696)

This commit is contained in:
Aaron Schulz 2008-07-02 10:33:42 +00:00
parent 163fcaa673
commit 69b77c726f
2 changed files with 5 additions and 5 deletions

View 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 )

View 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;
}