From 8e78d4c162f5788c76a29238236a910e483ceb89 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Wed, 23 Apr 2008 16:46:31 +0000 Subject: [PATCH] Don't show an undo link in the diff page when one of the revisions is deleted, since the undo page shows an error on such revisions. --- includes/DifferenceEngine.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index 3f41d1677c..49f9e65d7e 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -698,13 +698,14 @@ CONTROL; . " (" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . ")"; // Add an "undo" link $newUndo = $this->mNewPage->escapeLocalUrl( 'action=edit&undoafter=' . $this->mOldid . '&undo=' . $this->mNewid); - if ( $editable && $this->mNewRev->userCan(Revision::DELETED_TEXT) ) + if( $editable && !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) { $this->mNewtitle .= " (" . htmlspecialchars( wfMsg( 'editundo' ) ) . ")"; + } - if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) { - $this->mOldtitle = "{$this->mOldPagetitle}"; - } else if ( $this->mOldRev->isDeleted(Revision::DELETED_TEXT) ) { - $this->mOldtitle = ''.$this->mOldtitle.''; + if( !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) { + $this->mOldtitle = '' . $this->mOldPagetitle . ''; + } else if( $this->mOldRev->isDeleted( Revision::DELETED_TEXT ) ) { + $this->mOldtitle = '' . $this->mOldtitle . ''; } } -- 2.20.1