From: Aaron Schulz Date: Sun, 4 Feb 2007 18:16:38 +0000 (+0000) Subject: Restore minor visual updates for rev_deleted X-Git-Tag: 1.31.0-rc.0~54130 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=614c860b5c51a1ddf95b41fbec0200023486a477;p=lhc%2Fweb%2Fwiklou.git Restore minor visual updates for rev_deleted --- diff --git a/includes/DifferenceEngine.php b/includes/DifferenceEngine.php index d218917c33..234adcdac3 100644 --- a/includes/DifferenceEngine.php +++ b/includes/DifferenceEngine.php @@ -201,6 +201,10 @@ CONTROL; wfProfileIn( $fname ); $wgOut->addHTML( "

{$this->mPagetitle}

\n" ); + #add deleted rev tag if needed + if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + $wgOut->addWikiText( wfMsg( 'rev-deleted-text-permission' ) ); + } if( !$this->mNewRev->isCurrent() ) { $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false ); @@ -328,9 +332,12 @@ CONTROL; } } + #loadtext is permission safe, this just clears out the diff if ( !$this->loadText() ) { wfProfileOut( $fname ); return false; + } else if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) || !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + return ''; } $difftext = $this->generateDiffBody( $this->mOldtext, $this->mNewtext ); @@ -469,6 +476,14 @@ CONTROL; * Add the header to a diff body */ function addHeader( $diff, $otitle, $ntitle, $multi = '' ) { + global $wgOut; + + if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) { + $otitle = ''.$otitle.''; + } + if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { + $ntitle = ''.$ntitle.''; + } $header = "