From 18e3a9dc0e7c2ad521de9cac71535f990dcc1bcd Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 22 Mar 2009 12:34:07 +0000 Subject: [PATCH] *Use appropriate notarget message *Moved token check --- includes/specials/SpecialRevisiondelete.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index c888d90ed4..6dc18408da 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -41,6 +41,12 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { # Only one target set at a time please! $i = (bool)$this->file + (bool)$this->oldids + (bool)$this->logids + (bool)$this->artimestamps + (bool)$this->fileids + (bool)$this->oldimgs; + # No targets? + if( $i == 0 ) { + $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); + return; + } + # Too many targets? if( $i !== 1 ) { $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' ); return; @@ -62,11 +68,6 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { $wgOut->showErrorPage( 'revdelete-nologtype-title', 'revdelete-nologtype-text' ); return; } - # Check edit token on submission - if( $this->wasPosted && !$wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) ) { - $wgOut->addWikiMsg( 'sessionfailure' ); - return; - } # For reviewing deleted files...show it now if allowed if( $this->file ) { $oimage = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->page, $this->file ); @@ -741,7 +742,11 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { */ private function submit( $request ) { global $wgUser, $wgOut; - + # Check edit token on submission + if( $this->wasPosted && !$wgUser->matchEditToken( $request->getVal('wpEditToken') ) ) { + $wgOut->addWikiMsg( 'sessionfailure' ); + return false; + } $bitfield = $this->extractBitfield( $request ); $comment = $request->getText( 'wpReason' ); # Can the user set this field? -- 2.20.1