From: Platonides Date: Tue, 26 Oct 2010 22:34:18 +0000 (+0000) Subject: Address my own CR in r75332. X-Git-Tag: 1.31.0-rc.0~34285 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=902bab26cdc0733379c03ad32f99155534de6dc4;p=lhc%2Fweb%2Fwiklou.git Address my own CR in r75332. --- diff --git a/docs/hooks.txt b/docs/hooks.txt index 63e504a7ee..05d1521594 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -373,6 +373,10 @@ $article: the article (object) being deleted $output: the OutputPage object ($wgOut) &$reason: the reason (string) the article is being deleted +'ArticleContentOnDiff': before showing the article below a diff + $diffEngine: the DifferenceEngine + $output: the OutputPage object ($wgOut) + 'ArticleDelete': before an article is deleted $article: the article (object) being deleted $user: the user (object) deleting the article diff --git a/includes/diff/DifferenceInterface.php b/includes/diff/DifferenceInterface.php index 1b2c525f5c..9392a4ea1e 100644 --- a/includes/diff/DifferenceInterface.php +++ b/includes/diff/DifferenceInterface.php @@ -456,9 +456,8 @@ CONTROL; $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) ); $wgOut->addHTML( "\n\n" ); } - } elseif( wfRunHooks( 'ArticleContentOnDiff', array( $this, &$wgOut ) ) ) { - //TODO: document this hook - if( $pCache ) { + } elseif( wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) { + if ( $pCache ) { $article = new Article( $this->mTitle, 0 ); $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() ); if( $pOutput ) { @@ -467,13 +466,14 @@ CONTROL; $article->doViewParse(); } } else { - $wgOut->addWikiTextTidy( $this->mNewtext ); - } - if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { - $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); + $wgOut->addWikiTextTidy( $this->mNewtext ); } } + if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) { + $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting ); + } + # Add redundant patrol link on bottom... if( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan('patrol') ) { $sk = $wgUser->getSkin();