Index: trunk/phase3/includes/DifferenceEngine.php |
— | — | @@ -201,6 +201,10 @@ |
202 | 202 | wfProfileIn( $fname ); |
203 | 203 | |
204 | 204 | $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 | + } |
205 | 209 | |
206 | 210 | if( !$this->mNewRev->isCurrent() ) { |
207 | 211 | $oldEditSectionSetting = $wgOut->parserOptions()->setEditSection( false ); |
— | — | @@ -328,9 +332,12 @@ |
329 | 333 | } |
330 | 334 | } |
331 | 335 | |
| 336 | + #loadtext is permission safe, this just clears out the diff |
332 | 337 | if ( !$this->loadText() ) { |
333 | 338 | wfProfileOut( $fname ); |
334 | 339 | return false; |
| 340 | + } else if ( !$this->mOldRev->userCan(Revision::DELETED_TEXT) || !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { |
| 341 | + return ''; |
335 | 342 | } |
336 | 343 | |
337 | 344 | $difftext = $this->generateDiffBody( $this->mOldtext, $this->mNewtext ); |
— | — | @@ -469,6 +476,14 @@ |
470 | 477 | * Add the header to a diff body |
471 | 478 | */ |
472 | 479 | 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 | + } |
473 | 488 | $header = " |
474 | 489 | <table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'> |
475 | 490 | <tr> |