Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: preg_match(): Compilation failed: UTF-8 error: overlong 2-byte sequence at offset 9 #587

Open
MatzeKitt opened this issue May 4, 2024 · 2 comments
Labels
bug v3 This issue is for the new version (v3) of the plugin

Comments

@MatzeKitt
Copy link
Member

Describe the bug
I got the following error message in Antispam Bee v3:

ErrorException: Warning: preg_match(): Compilation failed: UTF-8 error: overlong 2-byte sequence at offset 9
#8 /wp-content/plugins/antispam-bee/src/Rules/RegexpSpam.php(147): AntispamBee\Rules\RegexpSpam::verify
#7 /wp-content/plugins/antispam-bee/src/Handlers/Rules.php(39): AntispamBee\Handlers\Rules::apply
#6 /wp-content/plugins/antispam-bee/src/Handlers/Reaction.php(33): AntispamBee\Handlers\Reaction::process
#5 /wp-content/plugins/antispam-bee/src/Handlers/Comment.php(52): AntispamBee\Handlers\Comment::process
#4 /wp-includes/class-wp-hook.php(324): WP_Hook::apply_filters
#3 /wp-includes/plugin.php(205): apply_filters
#2 /wp-includes/comment.php(2243): wp_new_comment
#1 /wp-includes/comment.php(3671): wp_handle_comment_submission
#0 /wp-comments-post.php(25): null

The comment has not been saved, so I don’t know its actual content, unfortunately. While such a comment is pretty sure bad, we should prevent such an error from happen.

Expected behavior
No error occurs.

@Zodiac1978 Zodiac1978 added v3 This issue is for the new version (v3) of the plugin bug labels May 5, 2024
@2ndkauboy
Copy link
Member

Would it make sense to use the HTML API to parse the content instead of using a RegEx in the new version? 🤔

@MatzeKitt
Copy link
Member Author

This would require bumping the required WordPress version from currently 4.5 to at least 6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v3 This issue is for the new version (v3) of the plugin
Projects
None yet
Development

No branches or pull requests

3 participants