From 181f8ed6c2a9d3572d66c080e1519997ef8abbfa Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 14 Jan 2006 15:07:08 +0000 Subject: [PATCH] Reverting this patch: * (bug 4104) 'OutputPageBeforeHTML' hook to postprocess article HTML on page view (comes after parser cache, if used). Patch by ThomasV. Something still bugged in this; was saving bogus history entries to parser cache. --- RELEASE-NOTES | 2 -- includes/Article.php | 3 +-- includes/OutputPage.php | 12 +++--------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d32ee956e0..708c3d7e04 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -477,8 +477,6 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 1103) Fix up redirect handling for images, categories Redirects are now followed from the top-level, outside of the Article content loading and viewing, for clarity and consistency. -* (bug 4104) 'OutputPageBeforeHTML' hook to postprocess article HTML on - page view (comes after parser cache, if used). Patch by ThomasV. * Linker::formatComment corrupted the passed title object on PHP 5 if the comment included a section link. Use clone() to make a safe copy. * Add wfClone() wrapper since we're still using PHP 4 on some servers. diff --git a/includes/Article.php b/includes/Article.php index 82891fc7bc..555f5bbec7 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -875,8 +875,7 @@ class Article { if( !$this->isCurrent() ) { $oldEditSectionSetting = $wgOut->mParserOptions->setEditSection( false ); } - # Display content and don't save to parser cache - $wgOut->addPrimaryWikiText( $text, $this, false ); + $wgOut->addWikiText( $text ); if( !$this->isCurrent() ) { $wgOut->mParserOptions->setEditSection( $oldEditSectionSetting ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f04bc6412e..7201e6e54f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -309,16 +309,12 @@ class OutputPage { $parserOutput = $wgParser->parse( $text, $article->mTitle, $this->mParserOptions, true, true, $this->mRevisionId ); - if ( $cache && $article && $parserOutput->getCacheTime() != -1 ) { + if ( $article && $parserOutput->getCacheTime() != -1 ) { $parserCache =& ParserCache::singleton(); $parserCache->save( $parserOutput, $article, $wgUser ); } - $this->addParserOutputNoText( $parserOutput ); - $text = $parserOutput->getText(); - wfRunHooks( 'OutputPageBeforeHTML',array( &$this, &$text ) ); - $parserOutput->setText( $text ); - $this->addHTML( $parserOutput->getText() ); + $this->addParserOutput( $parserOutput ); } /** @@ -355,9 +351,7 @@ class OutputPage { $this->mLanguageLinks += $parserOutput->getLanguageLinks(); $this->addCategoryLinks( $parserOutput->getCategories() ); $this->addKeywords( $parserOutput ); - $text = $parserOutput->getText(); - wfRunHooks( 'OutputPageBeforeHTML', array( &$this, &$text ) ); - $this->addHTML( $text ); + $this->addHTML( $parserOutput->getText() ); $t = $parserOutput->getTitleText(); if( !empty( $t ) ) { $this->setPageTitle( $t ); -- 2.20.1