From: Vsevolod Stakhov Date: Mon, 20 Feb 2017 16:36:42 +0000 (+0000) Subject: [Fix] Do not penalize characters just after numeric prefix X-Git-Tag: 1.5.0~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3480e172837207c3204a62405573250df9a8ef3f;p=thirdparty%2Frspamd.git [Fix] Do not penalize characters just after numeric prefix Issue: #1435 --- diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index 6e55ad358b..892815a5ca 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; }