# Allow admins to see deleted content if explicitly requested
$delId = $diff ? $diff : $oldid;
- $unhide = $wgRequest->getInt('unhide') == 1 && $wgUser->matchEditToken( $wgRequest->getVal('token'), $delId );
+ $unhide = $wgRequest->getInt('unhide') == 1
+ && $wgUser->matchEditToken( $wgRequest->getVal('token'), $delId );
# If we got diff and oldid in the query, we want to see a
# diff page instead of the article.
-
if( !is_null( $diff ) ) {
$wgOut->setPageTitle( $this->mTitle->getPrefixedText() );
'<div id="mw-diff-ntitle3">' . $newminor . $sk->revComment( $this->mNewRev, !$diffOnly, !$this->unhide ).$rdel."</div>" .
'<div id="mw-diff-ntitle4">' . $nextlink . $patrol . '</div>';
- # Output the diff if allowed
- $allowed = $this->mOldRev->userCan(Revision::DELETED_TEXT) && $this->mNewRev->userCan(Revision::DELETED_TEXT);
- $deleted = $this->mOldRev->isDeleted(Revision::DELETED_TEXT) || $this->mNewRev->isDeleted(Revision::DELETED_TEXT);
+ # Check if this user can see the revisions
+ $allowed = $this->mOldRev->userCan(Revision::DELETED_TEXT)
+ && $this->mNewRev->userCan(Revision::DELETED_TEXT);
+ $deleted = $this->mOldRev->isDeleted(Revision::DELETED_TEXT)
+ || $this->mNewRev->isDeleted(Revision::DELETED_TEXT);
+ # Output the diff if allowed...
if( $deleted && (!$this->unhide || !$allowed) ) {
$this->showDiffStyle();
$multi = $this->getMultiNotice();
$wgOut->addHTML( $this->addHeader( '', $oldHeader, $newHeader, $multi ) );
- $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n",
- array( 'rev-deleted-no-diff' ) );
+ if( !$allowed ) {
+ # Give explanation for why revision is not visible
+ $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n",
+ array( 'rev-deleted-no-diff' ) );
+ } else {
+ # Give explanation and add a link to view the diff...
+ $link = $this->mTitle->getFullUrl( "diff={$this->mNewid}&oldid={$this->mOldid}".
+ '&unhide=1&token='.urlencode( $wgUser->editToken($this->mNewid) ) );
+ $wgOut->wrapWikiMsg( "<div class='mw-warning plainlinks'>\n$1</div>\n",
+ array( 'rev-deleted-unhide-diff', $link ) );
+ }
} else if( $wgEnableHtmlDiff && $this->htmldiff ) {
$multi = $this->getMultiNotice();
$wgOut->addHTML('<div class="diff-switchtype">'.$sk->makeKnownLinkObj( $this->mTitle, wfMsgHtml( 'wikicodecomparison' ),
'rev-deleted-comment' => '(comment removed)',
'rev-deleted-user' => '(username removed)',
'rev-deleted-event' => '(log action removed)',
-'rev-deleted-text-permission' => 'This page revision has been removed from the public archives.
+'rev-deleted-text-permission' => 'This page revision has been \'\'\'removed from the public archives\'\'\'.
There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].',
-'rev-deleted-text-view' => 'This page revision has been removed from the public archives.
-As an administrator on {{SITENAME}} you can view it;
-there may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].',
-'rev-deleted-no-diff' => 'You cannot view this diff because one of the revisions has been removed from the public archives.
+'rev-deleted-text-view' => 'This page revision has been \'\'\'removed from the public archives\'\'\'.
+As an administrator on {{SITENAME}} you can view it; there may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].',
+'rev-deleted-no-diff' => 'You cannot view this diff because one of the revisions has been \'\'\'removed from the public archives\'\'\'.
There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].',
+'rev-deleted-unhide-diff' => 'One of the revisions of this diff has been \'\'\'removed from the public archives\'\'\'.
+There may be details in the [{{fullurl:Special:Log/delete|page={{FULLPAGENAMEE}}}} deletion log].
+As an administrator on {{SITENAME}} you can still [$1 view this diff] if you wish to proceed.',
'rev-delundel' => 'show/hide',
'revisiondelete' => 'Delete/undelete revisions',
'revdelete-nooldid-title' => 'Invalid target revision',
'rev-deleted-text-permission',
'rev-deleted-text-view',
'rev-deleted-no-diff',
+ 'rev-deleted-unhide-diff',
'rev-delundel',
'revisiondelete',
'revdelete-nooldid-title',