If we only want to show the diff this should make it faster. Sort of related to to...
authorPriyanka Dhanda <pdhanda@users.mediawiki.org>
Fri, 10 Dec 2010 22:47:16 +0000 (22:47 +0000)
committerPriyanka Dhanda <pdhanda@users.mediawiki.org>
Fri, 10 Dec 2010 22:47:16 +0000 (22:47 +0000)
includes/diff/DifferenceEngine.php

index f18d655..6b026b0 100644 (file)
@@ -427,6 +427,10 @@ CONTROL;
                wfProfileIn( __METHOD__ );
 
                $wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" );
+               if ( !wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) {
+                       return;
+               }
+               
                # Add deleted rev tag if needed
                if ( !$this->mNewRev->userCan( Revision::DELETED_TEXT ) ) {
                        $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1\n</div>\n", 'rev-deleted-text-permission' );
@@ -456,19 +460,17 @@ CONTROL;
                                $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) );
                                $wgOut->addHTML( "\n</pre>\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 );