r19798 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19797‎ | r19798 | r19799 >
Date:23:28, 5 February 2007
Author:aaron
Status:old
Tags:
Comment:
* Fix exception with "undo", use revText() for proper diffs
Modified paths:
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DifferenceEngine.php
@@ -336,8 +336,10 @@
337337 if ( !$this->loadText() ) {
338338 wfProfileOut( $fname );
339339 return false;
340 - } else if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) || !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
 340+ } else if ( $this->mOldRev && !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) {
341341 return '';
 342+ } else if ( $this->mNewRev && !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
 343+ return '';
342344 }
343345
344346 $difftext = $this->generateDiffBody( $this->mOldtext, $this->mNewtext );
@@ -478,10 +480,10 @@
479481 function addHeader( $diff, $otitle, $ntitle, $multi = '' ) {
480482 global $wgOut;
481483
482 - if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) {
 484+ if ( $this->mOldRev && $this->mOldRev->isDeleted(Revision::DELETED_TEXT) ) {
483485 $otitle = '<span class="history-deleted">'.$otitle.'</span>';
484486 }
485 - if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
 487+ if ( $this->mNewRev && $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) {
486488 $ntitle = '<span class="history-deleted">'.$ntitle.'</span>';
487489 }
488490 $header = "
@@ -610,13 +612,13 @@
611613 }
612614 if ( $this->mOldRev ) {
613615 // FIXME: permission tests
614 - $this->mOldtext = $this->mOldRev->getText();
 616+ $this->mOldtext = $this->mOldRev->revText();
615617 if ( $this->mOldtext === false ) {
616618 return false;
617619 }
618620 }
619621 if ( $this->mNewRev ) {
620 - $this->mNewtext = $this->mNewRev->getText();
 622+ $this->mNewtext = $this->mNewRev->revText();
621623 if ( $this->mNewtext === false ) {
622624 return false;
623625 }