From: Vsevolod Stakhov Date: Fri, 2 Aug 2019 17:28:11 +0000 (+0100) Subject: [Minor] Langdet: Exclude exceptions (e.g. urls) X-Git-Tag: 2.0~466 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=69aeac8388061295ac17518a223fe36efda4c2b1;p=rspamd.git [Minor] Langdet: Exclude exceptions (e.g. urls) --- diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c index 276771778..74c6f7247 100644 --- a/src/libmime/lang_detection.c +++ b/src/libmime/lang_detection.c @@ -939,6 +939,7 @@ rspamd_language_detector_random_select (GArray *ucs_tokens, guint nwords, /* Filter bad tokens */ if (tok->unicode.len >= 2 && + !(tok->flags & RSPAMD_STAT_TOKEN_FLAG_EXCEPTION) && u_isalpha (tok->unicode.begin[0]) && u_isalpha (tok->unicode.begin[tok->unicode.len - 1])) { offsets_out[out_idx] = sel;