aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/lang_detection.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-02 18:28:11 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-02 18:28:11 +0100
commit69aeac8388061295ac17518a223fe36efda4c2b1 (patch)
tree79fd74b0d5628b2e2e33c11d92704814f9bd96c7 /src/libmime/lang_detection.c
parent16093e49010ddf64295e520ff086e858b7447c5c (diff)
downloadrspamd-69aeac8388061295ac17518a223fe36efda4c2b1.tar.gz
rspamd-69aeac8388061295ac17518a223fe36efda4c2b1.zip
[Minor] Langdet: Exclude exceptions (e.g. urls)
Diffstat (limited to 'src/libmime/lang_detection.c')
-rw-r--r--src/libmime/lang_detection.c1
1 files changed, 1 insertions, 0 deletions
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;