From 3480e172837207c3204a62405573250df9a8ef3f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 20 Feb 2017 16:36:42 +0000 Subject: [PATCH] [Fix] Do not penalize characters just after numeric prefix Issue: #1435 --- src/plugins/chartable.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index 6e55ad358..892815a5c 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -271,7 +271,7 @@ rspamd_chartable_process_word_ascii (struct rspamd_task *task, ascii = 1, non_ascii } sc, last_sc; - gint same_script_count = 0; + gint same_script_count = 0, seen_alpha = FALSE; enum { start_process = 0, got_alpha, @@ -294,7 +294,7 @@ rspamd_chartable_process_word_ascii (struct rspamd_task *task, if (state == got_digit) { /* Penalize digit -> alpha translations */ - if (!is_url && !g_ascii_isxdigit (*p)) { + if (seen_alpha && !is_url && !g_ascii_isxdigit (*p)) { badness += 1.0; } } @@ -318,6 +318,7 @@ rspamd_chartable_process_word_ascii (struct rspamd_task *task, } } + seen_alpha = TRUE; state = got_alpha; } -- 2.39.5