summaryrefslogtreecommitdiff
path: root/includes/SpecialRevisiondelete.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/SpecialRevisiondelete.php')
-rw-r--r--includes/SpecialRevisiondelete.php19
1 files changed, 15 insertions, 4 deletions
diff --git a/includes/SpecialRevisiondelete.php b/includes/SpecialRevisiondelete.php
index 7fa8bbb4..afbb589c 100644
--- a/includes/SpecialRevisiondelete.php
+++ b/includes/SpecialRevisiondelete.php
@@ -13,7 +13,7 @@ function wfSpecialRevisiondelete( $par = null ) {
global $wgOut, $wgRequest, $wgUser;
$target = $wgRequest->getVal( 'target' );
- $oldid = $wgRequest->getInt( 'oldid' );
+ $oldid = $wgRequest->getIntArray( 'oldid' );
$sk = $wgUser->getSkin();
$page = Title::newFromUrl( $target );
@@ -23,6 +23,11 @@ function wfSpecialRevisiondelete( $par = null ) {
return;
}
+ if( is_null( $oldid ) ) {
+ $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+ return;
+ }
+
$form = new RevisionDeleteForm( $wgRequest );
if( $wgRequest->wasPosted() ) {
$form->submit( $wgRequest );
@@ -58,13 +63,15 @@ class RevisionDeleteForm {
function show( $request ) {
global $wgOut, $wgUser;
- $first = $this->revisions[0];
-
$wgOut->addWikiText( wfMsg( 'revdelete-selected', $this->page->getPrefixedText() ) );
$wgOut->addHtml( "<ul>" );
foreach( $this->revisions as $revid ) {
$rev = Revision::newFromTitle( $this->page, $revid );
+ if( !isset( $rev ) ) {
+ $wgOut->showErrorPage( 'revdelete-nooldid-title', 'revdelete-nooldid-text' );
+ return;
+ }
$wgOut->addHtml( $this->historyLine( $rev ) );
$bitfields[] = $rev->mDeleted; // FIXME
}
@@ -85,7 +92,8 @@ class RevisionDeleteForm {
$special = Title::makeTitle( NS_SPECIAL, 'Revisiondelete' );
$wgOut->addHtml( wfElement( 'form', array(
'method' => 'post',
- 'action' => $special->getLocalUrl( 'action=submit' ) ) ) );
+ 'action' => $special->getLocalUrl( 'action=submit' ) ),
+ null ) );
$wgOut->addHtml( '<fieldset><legend>' . wfMsgHtml( 'revdelete-legend' ) . '</legend>' );
foreach( $this->checks as $item ) {
@@ -180,6 +188,9 @@ class RevisionDeleter {
// To work!
foreach( $items as $revid ) {
$rev = Revision::newFromId( $revid );
+ if( !isset( $rev ) ) {
+ return false;
+ }
$this->updateRevision( $rev, $bitfield );
$this->updateRecentChanges( $rev, $bitfield );