Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -1473,7 +1473,8 @@ |
1474 | 1474 | $form .= Xml::hidden( 'validatedParams', ReaderFeedback::validationKey( $id, $wgUser->getId() ) ); |
1475 | 1475 | $form .= Xml::hidden( 'action', 'submit') . "\n"; |
1476 | 1476 | $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken() ) . "\n"; |
1477 | | - # Add review parameters |
| 1477 | + # Honeypot input |
| 1478 | + $form .= Xml::input( 'commentary', 12, '', array('style' => 'display:none;') ) . "\n"; |
1478 | 1479 | $form .= Xml::closeElement( 'fieldset' ); |
1479 | 1480 | $form .= Xml::closeElement( 'form' ); |
1480 | 1481 | if( $top ) { |
Index: trunk/extensions/FlaggedRevs/specialpages/ReaderFeedback_body.php |
— | — | @@ -50,9 +50,11 @@ |
51 | 51 | if( $this->validatedParams != self::validationKey( $this->oldid, $wgUser->getId() ) ) { |
52 | 52 | $wgOut->redirect( $this->page->getLocalUrl() ); |
53 | 53 | } |
54 | | - # Submit valid requests |
55 | | - if( $wgUser->matchEditToken( $wgRequest->getVal('wpEditToken') ) && $wgRequest->wasPosted() ) { |
| 54 | + # Submit valid requests. Check honeypot value for bots. |
| 55 | + if( $confirm && !$wgRequest->getVal( 'commentary' ) ) { |
56 | 56 | $ok = $this->submit(); |
| 57 | + } else { |
| 58 | + $ok = false; |
57 | 59 | } |
58 | 60 | # Go to graphs! |
59 | 61 | if( $ok ) { |