r19763 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19762‎ | r19763 | r19764 >
Date:18:16, 4 February 2007
Author:aaron
Status:old
Tags:
Comment:
Restore minor visual updates for rev_deleted
Modified paths:
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/DifferenceEngine.php
@@ -201,6 +201,10 @@
202202 wfProfileIn( $fname );
203203
204204 $wgOut->addHTML( "<hr /><h2>{$this->mPagetitle}</h2>\n" );
 205+ #add deleted rev tag if needed
 206+ if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
 207+ $wgOut->addWikiText( wfMsg( 'rev-deleted-text-permission' ) );
 208+ }
205209
206210 if( !$this->mNewRev->isCurrent() ) {
207211 $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false );
@@ -328,9 +332,12 @@
329333 }
330334 }
331335
 336+ #loadtext is permission safe, this just clears out the diff
332337 if ( !$this->loadText() ) {
333338 wfProfileOut( $fname );
334339 return false;
 340+ } else if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) || !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
 341+ return '';
335342 }
336343
337344 $difftext = $this->generateDiffBody( $this->mOldtext, $this->mNewtext );
@@ -469,6 +476,14 @@
470477 * Add the header to a diff body
471478 */
472479 function addHeader( $diff, $otitle, $ntitle, $multi = '' ) {
 480+ global $wgOut;
 481+
 482+ if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) ) {
 483+ $otitle = '<span class="history-deleted">'.$otitle.'</span>';
 484+ }
 485+ if ( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) {
 486+ $ntitle = '<span class="history-deleted">'.$ntitle.'</span>';
 487+ }
473488 $header = "
474489 <table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>
475490 <tr>