From: Rotem Liss Date: Wed, 23 Apr 2008 16:46:31 +0000 (+0000) Subject: Don't show an undo link in the diff page when one of the revisions is deleted, since... X-Git-Tag: 1.31.0-rc.0~48115 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=8e78d4c162f5788c76a29238236a910e483ceb89;p=lhc%2Fweb%2Fwiklou.git 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. --- 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 . ''; } }