r48678 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48677‎ | r48678 | r48679 >
Date:12:34, 22 March 2009
Author:aaron
Status:ok
Tags:
Comment:
*Use appropriate notarget message
*Moved token check
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -41,6 +41,12 @@
4242 # Only one target set at a time please!
4343 $i = (bool)$this->file + (bool)$this->oldids + (bool)$this->logids
4444 + (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?
4551 if( $i !== 1 ) {
4652 $wgOut->showErrorPage( 'revdelete-toomanytargets-title', 'revdelete-toomanytargets-text' );
4753 return;
@@ -62,11 +68,6 @@
6369 $wgOut->showErrorPage( 'revdelete-nologtype-title', 'revdelete-nologtype-text' );
6470 return;
6571 }
66 - # Check edit token on submission
67 - if( $this->wasPosted && !$wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) ) {
68 - $wgOut->addWikiMsg( 'sessionfailure' );
69 - return;
70 - }
7172 # For reviewing deleted files...show it now if allowed
7273 if( $this->file ) {
7374 $oimage = RepoGroup::singleton()->getLocalRepo()->newFromArchiveName( $this->page, $this->file );
@@ -741,7 +742,11 @@
742743 */
743744 private function submit( $request ) {
744745 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+ }
746751 $bitfield = $this->extractBitfield( $request );
747752 $comment = $request->getText( 'wpReason' );
748753 # Can the user set this field?

Status & tagging log