From 5d95c385be2209c79bbc75ef841942f7de295c3c Mon Sep 17 00:00:00 2001 From: Priyanka Dhanda Date: Fri, 10 Dec 2010 22:47:16 +0000 Subject: [PATCH] If we only want to show the diff this should make it faster. Sort of related to to bug 25757 --- includes/diff/DifferenceEngine.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index f18d655f96..6b026b0990 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -427,6 +427,10 @@ CONTROL; wfProfileIn( __METHOD__ ); $wgOut->addHTML( "

{$this->mPagetitle}

\n" ); + if ( !wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) { + return; + } + # Add deleted rev tag if needed if ( !$this->mNewRev->userCan( Revision::DELETED_TEXT ) ) { $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); @@ -456,19 +460,17 @@ CONTROL; $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) ); $wgOut->addHTML( "\n\n" ); } - } elseif ( wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) { - if ( $pCache ) { - $article = new Article( $this->mTitle, 0 ); - $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() ); - if ( $pOutput ) { - $wgOut->addParserOutput( $pOutput ); - } else { - $article->doViewParse(); - } + } elseif ( $pCache ) { + $article = new Article( $this->mTitle, 0 ); + $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() ); + if( $pOutput ) { + $wgOut->addParserOutput( $pOutput ); } else { - $wgOut->addWikiTextTidy( $this->mNewtext ); - } - } + $article->doViewParse(); + } + } else { + $wgOut->addWikiTextTidy( $this->mNewtext ); + } if ( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); -- 2.20.1