From 57b47a742def523c06e0404ca275825e497dc365 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 5 Feb 2007 23:28:17 +0000 Subject: [PATCH] * Fix exception with "undo", use revText() for proper diffs --- includes/DifferenceEngine.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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; } -- 2.20.1