From: Aaron Schulz Date: Mon, 5 Feb 2007 23:28:17 +0000 (+0000) Subject: * Fix exception with "undo", use revText() for proper diffs X-Git-Tag: 1.31.0-rc.0~54116 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=57b47a742def523c06e0404ca275825e497dc365;p=lhc%2Fweb%2Fwiklou.git * Fix exception with "undo", use revText() for proper diffs --- diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 234adcdac3..e6218b6d9c 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -336,7 +336,9 @@ CONTROL; if ( !$this->loadText() ) { wfProfileOut( $fname ); return false; - } else if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) || !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + } else if ( $this->mOldRev && !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) { + return ''; + } else if ( $this->mNewRev && !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { return ''; } @@ -478,10 +480,10 @@ CONTROL; function addHeader( $diff, $otitle, $ntitle, $multi = '' ) { global $wgOut; - if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) { + if ( $this->mOldRev && $this->mOldRev->isDeleted(Revision::DELETED_TEXT) ) { $otitle = ''.$otitle.''; } - if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + if ( $this->mNewRev && $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) { $ntitle = ''.$ntitle.''; } $header = " @@ -610,13 +612,13 @@ CONTROL; } if ( $this->mOldRev ) { // FIXME: permission tests - $this->mOldtext = $this->mOldRev->getText(); + $this->mOldtext = $this->mOldRev->revText(); if ( $this->mOldtext === false ) { return false; } } if ( $this->mNewRev ) { - $this->mNewtext = $this->mNewRev->getText(); + $this->mNewtext = $this->mNewRev->revText(); if ( $this->mNewtext === false ) { return false; }