Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php |
— | — | @@ -29,7 +29,6 @@ |
30 | 30 | protected $comment = ''; |
31 | 31 | protected $dims = array(); |
32 | 32 | |
33 | | - protected $unapprovedTags = 0; |
34 | 33 | protected $oflags = array(); |
35 | 34 | protected $inputLock = 0; # Disallow bad submissions |
36 | 35 | |
— | — | @@ -203,35 +202,25 @@ |
204 | 203 | protected function checkSettings() { |
205 | 204 | $status = $this->checkTarget(); |
206 | 205 | if ( $status !== true ) { |
207 | | - return $status; // bad target |
| 206 | + return $status; // bad page target |
| 207 | + } elseif ( !$this->oldid ) { |
| 208 | + return 'review_no_oldid'; // bad revision target |
208 | 209 | } |
209 | | - if ( !$this->oldid ) { |
210 | | - return 'review_no_oldid'; |
211 | | - } |
212 | | - # Check that this is an approval or de-approval |
| 210 | + # Check that an action is specified (approve, reject, de-approve) |
213 | 211 | if ( $this->getAction() === null ) { |
214 | 212 | return 'review_param_missing'; // user didn't say |
215 | 213 | } |
216 | 214 | # Fill in implicit tag data for binary flag case |
217 | 215 | $iDims = $this->implicitDims(); |
218 | 216 | if ( $iDims ) { |
219 | | - $this->dims = $iDims; |
220 | | - } else { |
221 | | - foreach ( FlaggedRevs::getTags() as $tag ) { |
222 | | - if ( $this->dims[$tag] === 0 ) { |
223 | | - $this->unapprovedTags++; |
224 | | - } |
225 | | - } |
| 217 | + $this->dims = $iDims; // binary flag case |
226 | 218 | } |
227 | | - # We must at least rate each category as 1, the minimum |
228 | | - # Exception: we can rate ALL as unapproved to depreciate a revision |
229 | | - if ( $this->unapprovedTags |
230 | | - && $this->unapprovedTags < count( FlaggedRevs::getTags() ) ) |
231 | | - { |
232 | | - return 'review_too_low'; |
233 | | - } |
234 | | - # Special token to discourage fiddling with template/files... |
235 | 219 | if ( $this->getAction() === 'approve' ) { |
| 220 | + # We must at least rate each category as 1, the minimum |
| 221 | + if ( in_array( 0, $this->dims, true ) ) { |
| 222 | + return 'review_too_low'; |
| 223 | + } |
| 224 | + # Special token to discourage fiddling with template/files... |
236 | 225 | $k = self::validationKey( |
237 | 226 | $this->templateParams, $this->imageParams, $this->fileVersion, $this->oldid ); |
238 | 227 | if ( $this->validatedParams !== $k ) { |