From 5fae7ad49bd1d94742ef4d2f0ee9765074d0f249 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 24 Jul 2006 05:25:12 +0000 Subject: [PATCH] Made OutputPage::tryParserCache() use addParserOutputNoText(), this fixes {{DISPLAYTITLE:}} and any similar entity. Added accessor for the subtitle in ParserOutput. --- includes/OutputPage.php | 12 +++--------- includes/Parser.php | 4 +++- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 78374cae38..75068067f4 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -308,6 +308,8 @@ class OutputPage { } if ( $parserOutput->mHTMLtitle != "" ) { $this->mPagetitle = $parserOutput->mHTMLtitle ; + } + if ( $parserOutput->mSubtitle != '' ) { $this->mSubtitle .= $parserOutput->mSubtitle ; } } @@ -385,18 +387,10 @@ class OutputPage { $parserCache =& ParserCache::singleton(); $parserOutput = $parserCache->get( $article, $user ); if ( $parserOutput !== false ) { - $this->mLanguageLinks += $parserOutput->getLanguageLinks(); - $this->addCategoryLinks( $parserOutput->getCategories() ); - $this->addKeywords( $parserOutput ); - $this->mNewSectionLink = $parserOutput->getNewSection(); - $this->mNoGallery = $parserOutput->getNoGallery(); + $this->addParserOutputNoText( $parserOutput ); $text = $parserOutput->getText(); wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) ); $this->addHTML( $text ); - $t = $parserOutput->getTitleText(); - if( !empty( $t ) ) { - $this->setPageTitle( $t ); - } return true; } else { return false; diff --git a/includes/Parser.php b/includes/Parser.php index 1079f5b822..66196436d9 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4427,6 +4427,7 @@ class ParserOutput function &getImages() { return $this->mImages; } function &getExternalLinks() { return $this->mExternalLinks; } function getNoGallery() { return $this->mNoGallery; } + function getSubtitle() { return $this->mSubtitle; } function containsOldMagic() { return $this->mContainsOldMagic; } function setText( $text ) { return wfSetVar( $this->mText, $text ); } @@ -4434,7 +4435,8 @@ class ParserOutput function setCategoryLinks( $cl ) { return wfSetVar( $this->mCategories, $cl ); } function setContainsOldMagic( $com ) { return wfSetVar( $this->mContainsOldMagic, $com ); } function setCacheTime( $t ) { return wfSetVar( $this->mCacheTime, $t ); } - function setTitleText( $t ) { return wfSetVar ($this->mTitleText, $t); } + function setTitleText( $t ) { return wfSetVar($this->mTitleText, $t); } + function setSubtitle( $st ) { return wfSetVar( $this->mSubtitle, $st ); } function addCategory( $c, $sort ) { $this->mCategories[$c] = $sort; } function addImage( $name ) { $this->mImages[$name] = 1; } -- 2.20.1