r76459 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76458‎ | r76459 | r76460 >
Date:18:30, 10 November 2010
Author:demon
Status:ok
Tags:
Comment:
Push r76444 merge to my testing branch
Modified paths:
  • /branches/chad-pre-wmf-merge (modified) (history)
  • /branches/chad-pre-wmf-merge/docs/hooks.txt (modified) (history)
  • /branches/chad-pre-wmf-merge/includes/diff/DifferenceInterface.php (modified) (history)

Diff [purge]

Index: branches/chad-pre-wmf-merge/docs/hooks.txt
@@ -356,6 +356,10 @@
357357 $output: the OutputPage object ($wgOut)
358358 &$reason: the reason (string) the article is being deleted
359359
 360+'ArticleContentOnDiff': before showing the article below a diff
 361+ $diffEngine: the DifferenceEngine
 362+ $output: the OutputPage object ($wgOut)
 363+
360364 'ArticleDelete': before an article is deleted
361365 $article: the article (object) being deleted
362366 $user: the user (object) deleting the article
Index: branches/chad-pre-wmf-merge/includes/diff/DifferenceInterface.php
@@ -443,21 +443,24 @@
444444 $wgOut->addHTML( htmlspecialchars( $this->mNewtext ) );
445445 $wgOut->addHTML( "\n</pre>\n" );
446446 }
447 - } elseif( $pCache ) {
448 - $article = new Article( $this->mTitle, 0 );
449 - $pOutput = ParserCache::singleton()->get( $article, $wgUser );
450 - if( $pOutput ) {
451 - $wgOut->addParserOutput( $pOutput );
 447+ } elseif( wfRunHooks( 'ArticleContentOnDiff', array( $this, $wgOut ) ) ) {
 448+ if ( $pCache ) {
 449+ $article = new Article( $this->mTitle, 0 );
 450+ $pOutput = ParserCache::singleton()->get( $article, $wgOut->parserOptions() );
 451+ if( $pOutput ) {
 452+ $wgOut->addParserOutput( $pOutput );
 453+ } else {
 454+ $article->doViewParse();
 455+ }
452456 } else {
453 - $article->doViewParse();
 457+ $wgOut->addWikiTextTidy( $this->mNewtext );
454458 }
455 - } else {
456 - $wgOut->addWikiTextTidy( $this->mNewtext );
457459 }
458 -
 460+
459461 if( is_object( $this->mNewRev ) && !$this->mNewRev->isCurrent() ) {
460462 $wgOut->parserOptions()->setEditSection( $oldEditSectionSetting );
461463 }
 464+
462465 # Add redundant patrol link on bottom...
463466 if( $this->mRcidMarkPatrolled && $this->mTitle->quickUserCan('patrol') ) {
464467 $sk = $wgUser->getSkin();
Property changes on: branches/chad-pre-wmf-merge/includes/diff/DifferenceInterface.php
___________________________________________________________________
Modified: svn:mergeinfo
465468 Merged /trunk/phase3/includes/diff/DifferenceInterface.php:r75332,75481
Property changes on: branches/chad-pre-wmf-merge
___________________________________________________________________
Modified: svn:mergeinfo
466469 Merged /trunk/phase3:r75332,75481

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76444MFT r75332, r75481: Adding hook for changing content on diff pagesdemon15:03, 10 November 2010

Status & tagging log