r76919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76918‎ | r76919 | r76920 >
Date:23:29, 17 November 2010
Author:reedy
Status:ok
Tags:
Comment:
Do the stuff that requires no DB checking first
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php
@@ -65,14 +65,14 @@
6666 $dbw->begin();
6767 // Change the status if allowed
6868 $statusChanged = false;
69 - if ( $this->validPost( 'codereview-set-status' ) && $this->mRev->isValidStatus( $status ) ) {
 69+ if ( $this->mRev->isValidStatus( $status ) && $this->validPost( 'codereview-set-status' ) ) {
7070 $statusChanged = $this->mRev->setStatus( $status, $wgUser );
7171 }
7272 $addTags = $removeTags = array();
73 - if ( $this->validPost( 'codereview-add-tag' ) && count( $addTags ) ) {
 73+ if ( count( $addTags ) && $this->validPost( 'codereview-add-tag' ) ) {
7474 $validAddTags = $addTags;
7575 }
76 - if ( $this->validPost( 'codereview-remove-tag' ) && count( $removeTags ) ) {
 76+ if ( count( $removeTags ) && $this->validPost( 'codereview-remove-tag' ) ) {
7777 $validRemoveTags = $removeTags;
7878 }
7979 // If allowed to change any tags, then do so
@@ -80,12 +80,12 @@
8181 $this->mRev->changeTags( $validAddTags, $validRemoveTags, $wgUser );
8282 }
8383 // Add any signoffs
84 - if ( $this->validPost( 'codereview-signoff' ) && count( $signoffFlags ) ) {
 84+ if ( count( $signoffFlags ) && $this->validPost( 'codereview-signoff' ) ) {
8585 $this->mRev->addSignoff( $wgUser, $signoffFlags );
8686 }
8787 // Add any comments
8888 $commentAdded = false;
89 - if ( $this->validPost( 'codereview-post-comment' ) && strlen( $commentText ) ) {
 89+ if ( strlen( $commentText ) && $this->validPost( 'codereview-post-comment' ) ) {
9090 // $isPreview = $wgRequest->getCheck( 'wpPreview' );
9191 $commentId = $this->mRev->saveComment( $commentText, $review, $parent );
9292

Status & tagging log