$where = $revObjs = array();
$dbr = wfGetDB( DB_SLAVE );
+
+ $revisions = 0;
// Live revisions...
if( $this->deleteKey=='oldid' ) {
// Run through and pull all our data in one query
}
foreach( $this->revisions as $revid ) {
// Hiding top revisison is bad
- if( !is_object($revObjs[$revid]) || $revObjs[$revid]->isCurrent() ) {
- $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
- return;
+ if( !isset($revObjs[$revid]) || $revObjs[$revid]->isCurrent() ) {
+ continue;
} else if( !$revObjs[$revid]->userCan(Revision::DELETED_RESTRICTED) ) {
// If a rev is hidden from sysops
if( $action != 'submit') {
}
$UserAllowed = false;
}
+ $revisions++;
$wgOut->addHtml( $this->historyLine( $revObjs[$revid] ) );
$bitfields |= $revObjs[$revid]->mDeleted;
}
'len' => $row->ar_len) );
}
foreach( $this->archrevs as $timestamp ) {
- if( !is_object($revObjs[$timestamp]) ) {
- $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
- return;
- }
- }
- foreach( $revObjs as $rev ) {
- if( !$rev->userCan(Revision::DELETED_RESTRICTED) ) {
+ if( !isset($revObjs[$timestamp]) ) {
+ continue;
+ } else if( !$revObjs[$timestamp]->userCan(Revision::DELETED_RESTRICTED) ) {
// If a rev is hidden from sysops
if( $action != 'submit') {
$wgOut->permissionRequired( 'hiderevision' );
}
$UserAllowed = false;
}
- $wgOut->addHtml( $this->historyLine( $rev ) );
- $bitfields |= $rev->mDeleted;
+ $revisions++;
+ $wgOut->addHtml( $this->historyLine( $revObjs[$timestamp] ) );
+ $bitfields |= $revObjs[$timestamp]->mDeleted;
}
}
+ if( !$revisions ) {
+ $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+ return;
+ }
+
$wgOut->addHtml( "</ul>" );
$wgOut->addWikiText( wfMsgHtml( 'revdelete-text' ) );
$where = $filesObjs = array();
$dbr = wfGetDB( DB_SLAVE );
// Live old revisions...
+ $revisions = 0;
if( $this->deleteKey=='oldimage' ) {
// Run through and pull all our data in one query
foreach( $this->ofiles as $timestamp ) {
foreach( $this->ofiles as $timestamp ) {
$archivename = $timestamp.'!'.$this->page->getDbKey();
if( !isset($filesObjs[$archivename]) ) {
- $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
- return;
- }
- }
- foreach( $filesObjs as $file ) {
- if( !isset($file) ) {
- $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
- return;
- } else if( !$file->userCan(File::DELETED_RESTRICTED) ) {
+ continue;
+ } else if( !$filesObjs[$archivename]->userCan(File::DELETED_RESTRICTED) ) {
// If a rev is hidden from sysops
if( $action != 'submit' ) {
$wgOut->permissionRequired( 'hiderevision' );
}
$UserAllowed = false;
}
+ $revisions++;
// Inject history info
- $wgOut->addHtml( $this->fileLine( $file ) );
- $bitfields |= $file->deleted;
+ $wgOut->addHtml( $this->fileLine( $filesObjs[$archivename] ) );
+ $bitfields |= $filesObjs[$archivename]->deleted;
}
// Archived files...
} else {
foreach( $this->afiles as $fileid ) {
if( !isset($filesObjs[$fileid]) ) {
- $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
- return;
+ continue;
} else if( !$filesObjs[$fileid]->userCan(File::DELETED_RESTRICTED) ) {
// If a rev is hidden from sysops
if( $action != 'submit' ) {
}
$UserAllowed = false;
}
+ $revisions++;
// Inject history info
$wgOut->addHtml( $this->archivedfileLine( $filesObjs[$fileid] ) );
$bitfields |= $filesObjs[$fileid]->deleted;
}
}
+ if( !$revisions ) {
+ $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+ return;
+ }
+
$wgOut->addHtml( "</ul>" );
$wgOut->addWikiText( wfMsgHtml( 'revdelete-text' ) );
$where = $logRows = array();
$dbr = wfGetDB( DB_SLAVE );
// Run through and pull all our data in one query
+ $logItems = 0;
foreach( $this->events as $logid ) {
$where[] = intval($logid);
}
foreach( $this->events as $logid ) {
// Don't hide from oversight log!!!
if( !isset( $logRows[$logid] ) || $logRows[$logid]->log_type=='suppress' ) {
- $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
- return;
+ continue;
} else if( !LogEventsList::userCan( $logRows[$logid],Revision::DELETED_RESTRICTED) ) {
// If an event is hidden from sysops
if( $action != 'submit') {
}
$UserAllowed = false;
}
+ $logItems++;
$wgOut->addHtml( $this->logLine( $logRows[$logid] ) );
$bitfields |= $logRows[$logid]->log_deleted;
}
+ if( !$logItems ) {
+ $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+ return;
+ }
+
$wgOut->addHtml( "</ul>" );
$wgOut->addWikiMsg( 'revdelete-text' );