diff options
author | heraklit256 <37872459+heraklit256@users.noreply.github.com> | 2018-12-19 19:26:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-19 19:26:34 +0000 |
commit | e36509986bcc059a99ca5c08d9a7d90c1f1217f5 (patch) | |
tree | a715e2e95154a1f6aaf62bf7f73adb002c823fa7 /src/libutil/multipattern.c | |
parent | 5f4617948c64483dfb648b5bfe784f8c84dd87ea (diff) | |
parent | 714faa2b804507f622d4780be646eaf8146a166d (diff) | |
download | rspamd-e36509986bcc059a99ca5c08d9a7d90c1f1217f5.tar.gz rspamd-e36509986bcc059a99ca5c08d9a7d90c1f1217f5.zip |
Merge pull request #8 from rspamd/master
merge upstream into local master
Diffstat (limited to 'src/libutil/multipattern.c')
-rw-r--r-- | src/libutil/multipattern.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c index 94b5398b3..e4a39d5fe 100644 --- a/src/libutil/multipattern.c +++ b/src/libutil/multipattern.c @@ -193,6 +193,12 @@ rspamd_multipattern_pattern_filter (const gchar *pattern, gsize len, gchar *ret = NULL; #ifdef WITH_HYPERSCAN if (rspamd_hs_check ()) { + gint gl_flags = RSPAMD_REGEXP_ESCAPE_ASCII; + + if (flags & RSPAMD_MULTIPATTERN_UTF8) { + gl_flags |= RSPAMD_REGEXP_ESCAPE_UTF; + } + if (flags & RSPAMD_MULTIPATTERN_TLD) { ret = rspamd_multipattern_escape_tld_hyperscan (pattern, len, dst_len); } @@ -201,10 +207,11 @@ rspamd_multipattern_pattern_filter (const gchar *pattern, gsize len, *dst_len = rspamd_strlcpy (ret, pattern, len + 1); } else if (flags & RSPAMD_MULTIPATTERN_GLOB) { - ret = rspamd_str_regexp_escape (pattern, len, dst_len, TRUE); + ret = rspamd_str_regexp_escape (pattern, len, dst_len, + gl_flags | RSPAMD_REGEXP_ESCAPE_GLOB); } else { - ret = rspamd_str_regexp_escape (pattern, len, dst_len, FALSE); + ret = rspamd_str_regexp_escape (pattern, len, dst_len, gl_flags); } return ret; |