From 2568bdd681a98b000d8936d72f7c0ec97489784c Mon Sep 17 00:00:00 2001 From: Florian Brinkmann Date: Wed, 18 Oct 2023 14:57:24 +0200 Subject: [PATCH] chore: add additional regex --- src/Helpers/SpamReasonTextHelper.php | 1 + src/Rules/CountrySpam.php | 1 - src/Rules/RegexpSpam.php | 5 ++++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Helpers/SpamReasonTextHelper.php b/src/Helpers/SpamReasonTextHelper.php index 58b5cf54..9ca18aae 100644 --- a/src/Helpers/SpamReasonTextHelper.php +++ b/src/Helpers/SpamReasonTextHelper.php @@ -48,6 +48,7 @@ public static function get_texts_by_slugs( array $slugs ) { $legacy_rules = [ 'server' => esc_html_x( 'Fake IP', 'legacy spam reason label', 'antispam-bee' ) ]; + if ( array_key_exists( $slug, $legacy_rules ) ) { $texts[] = esc_html_x( /* translators: s=slug of unknown spam reason */ diff --git a/src/Rules/CountrySpam.php b/src/Rules/CountrySpam.php index 9a13686e..7dd81dd1 100644 --- a/src/Rules/CountrySpam.php +++ b/src/Rules/CountrySpam.php @@ -19,7 +19,6 @@ public static function verify( $item ) { } $ip = $item['comment_author_IP']; - // Todo: Migrate ab_country_allowed, ab_country_denied $country_allowed = Settings::get_option( static::get_option_name( 'allowed' ), $item['reaction_type'] ); $country_allowed = $country_allowed ? $country_allowed : ''; $country_denied = Settings::get_option( static::get_option_name( 'denied' ), $item['reaction_type'] ); diff --git a/src/Rules/RegexpSpam.php b/src/Rules/RegexpSpam.php index 78d0bb56..082cebb9 100644 --- a/src/Rules/RegexpSpam.php +++ b/src/Rules/RegexpSpam.php @@ -77,7 +77,7 @@ public static function verify( $item ) { 'body' => '\<\!.+?mfunc.+?\>', ], [ - 'author' => 'moncler|north face|vuitton|handbag|burberry|outlet|prada|cialis|viagra|maillot|oakley|ralph lauren|ray ban|iphone|プラダ', + 'author' => 'moncler|north face|vuitton|handbag|burberry|outlet|prada|cialis|viagra|maillot|oakley|ralph lauren|ray ban|iphone|プラダ|[^\w]?porn[o]?[s]?[^\w]?|[^\w]?pornstar[^\w]?|^20bet$', ], [ 'host' => '^(www\.)?fkbook\.co\.uk$|^(www\.)?nsru\.net$|^(www\.)?goo\.gl$|^(www\.)?bit\.ly$', @@ -92,6 +92,9 @@ public static function verify( $item ) { 'body' => 'dating|sex|lotto|pharmacy', 'email' => '@mail\.ru|@yandex\.', ], + [ + 'rawurl' => '^http[s]?:\/\/(accounts\.)?binance\.com\/[a-zA-Z-]+\/register(-person)?\?ref=[\w]+' + ] ]; $quoted_author = preg_quote( $subject['author'], '/' );