Skip to content

Commit

Permalink
chore: add additional regex
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbrinkmann committed Oct 18, 2023
1 parent 2d5c21e commit 2568bdd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Helpers/SpamReasonTextHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion src/Rules/CountrySpam.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] );
Expand Down
5 changes: 4 additions & 1 deletion src/Rules/RegexpSpam.php
Original file line number Diff line number Diff line change
Expand Up @@ -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$',
Expand All @@ -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'], '/' );
Expand Down

0 comments on commit 2568bdd

Please sign in to comment.