jenkins-bot has submitted this change and it was merged.

Change subject: Don't set review flag if it wasn't in the query parameters
......................................................................


Don't set review flag if it wasn't in the query parameters

Change-Id: I7ea5d458a72083513c9c27f50d459122dba9cae3
---
M api/actions/ApiReview.php
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/api/actions/ApiReview.php b/api/actions/ApiReview.php
index 7881632..f0452c2 100644
--- a/api/actions/ApiReview.php
+++ b/api/actions/ApiReview.php
@@ -63,6 +63,10 @@
                // The flagging parameters have the form 'flag_$name'.
                // Extract them and put the values into $form->dims
                foreach ( FlaggedRevs::getTags() as $tag ) {
+                       if ( !isset( $params['flag_' . $tag] ) ) {
+                               // This shouldn't happen, but sometimes it does.
+                               $this->dieUsage( "'flag_$tag' parameter missing 
from query.", 'missingflag' );
+                       }
                        $form->setDim( $tag, (int)$params['flag_' . $tag] );
                }
                if ( $form->getAction() === 'approve' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/179525
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ea5d458a72083513c9c27f50d459122dba9cae3
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/FlaggedRevs
Gerrit-Branch: master
Gerrit-Owner: Chad <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to