Open
Conversation
The new code is using a `foreach` to get the two fields, but requires them to be in the correct order. This change uses a code similar to v2 which would get the parameters, independent of the order. Fixes: #506 (review)
Draft
florianbrinkmann
approved these changes
Jul 28, 2025
We do not use this prefix and a new rule now fails because it is too short. Remove it from the configuration.
stklcode
reviewed
Jul 31, 2025
|
|
||
| if ( ! isset( $fields['plugin_field'] ) ) { | ||
| // Honeypot field was not present in $_POST data. | ||
| $_POST['ab_spam__invalid_request'] = 1; |
Contributor
There was a problem hiding this comment.
There is a test case for this field that now fails:
antispam-bee/tests/Unit/Rules/HoneypotTest.php
Lines 72 to 74 in 78e84de
Should be either adjusted or removed if obsolete.
Member
Author
There was a problem hiding this comment.
This test was removed. I've also changed the field names in the tests, since they are currently not dynamic in the way proposed in the tests. The hidden field is always comment for this comment form. This is currently hardcoded in our plugin (as it was in v2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new code is using a
foreachto get the two fields, but requires them to be in the correct order.This change uses a code similar to v2 which would get the parameters, independent of the order.
Fixes: #506 (review)