From 614c860b5c51a1ddf95b41fbec0200023486a477 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 4 Feb 2007 18:16:38 +0000 Subject: [PATCH] Restore minor visual updates for rev_deleted --- includes/DifferenceEngine.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 = " -- 2.20.1