Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php |
— | — | @@ -41,6 +41,12 @@ |
42 | 42 | # Only one target set at a time please! |
43 | 43 | $i = (bool)$this->file + (bool)$this->oldids + (bool)$this->logids |
44 | 44 | + (bool)$this->artimestamps + (bool)$this->fileids + (bool)$this->oldimgs; |
| 45 | + # No targets? |
| 46 | + if( $i == 0 ) { |
| 47 | + $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
| 48 | + return; |
| 49 | + } |
| 50 | + # Too many targets? |
45 | 51 | if( $i !== 1 ) { |
46 | 52 | $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' ); |
47 | 53 | return; |
— | — | @@ -62,11 +68,6 @@ |
63 | 69 | $wgOut->showErrorPage( 'revdelete-nologtype-title', 'revdelete-nologtype-text' ); |
64 | 70 | return; |
65 | 71 | } |
66 | | - # Check edit token on submission |
67 | | - if( $this->wasPosted && !$wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) ) { |
68 | | - $wgOut->addWikiMsg( 'sessionfailure' ); |
69 | | - return; |
70 | | - } |
71 | 72 | # For reviewing deleted files...show it now if allowed |
72 | 73 | if( $this->file ) { |
73 | 74 | $oimage = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->page, $this->file ); |
— | — | @@ -741,7 +742,11 @@ |
742 | 743 | */ |
743 | 744 | private function submit( $request ) { |
744 | 745 | global $wgUser, $wgOut; |
745 | | - |
| 746 | + # Check edit token on submission |
| 747 | + if( $this->wasPosted && !$wgUser->matchEditToken( $request->getVal('wpEditToken') ) ) { |
| 748 | + $wgOut->addWikiMsg( 'sessionfailure' ); |
| 749 | + return false; |
| 750 | + } |
746 | 751 | $bitfield = $this->extractBitfield( $request ); |
747 | 752 | $comment = $request->getText( 'wpReason' ); |
748 | 753 | # Can the user set this field? |