From 2d5c21eb93321f736450c871ec21dc77f19b6238 Mon Sep 17 00:00:00 2001 From: Florian Brinkmann Date: Wed, 18 Oct 2023 14:16:23 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20mark=20old=20ASB=20rules=20as=20=C2=BB?= =?UTF-8?q?legacy=C2=AB=20in=20spam=20reason=20select=20instead=20of=20?= =?UTF-8?q?=C2=BBunknown=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Helpers/SpamReasonTextHelper.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Helpers/SpamReasonTextHelper.php b/src/Helpers/SpamReasonTextHelper.php index d953f52d..58b5cf54 100644 --- a/src/Helpers/SpamReasonTextHelper.php +++ b/src/Helpers/SpamReasonTextHelper.php @@ -45,7 +45,18 @@ public static function get_texts_by_slugs( array $slugs ) { continue; } - // @todo: don’t mark our old rules as »unknown« but »legacy« + $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 */ + sprintf( 'Legacy rule: %s', $legacy_rules[ $slug ] ), + 'spam-reason-legacy-text', + 'antispam-bee' + ); + continue; + } $texts[] = esc_html_x( /* translators: s=slug of unknown spam reason */ sprintf( 'Unknown rule: %s', $slug ),