aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-20 20:44:49 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-20 20:45:22 +0000
commita45141c003e065341474de0ec0b4310b2f4437c8 (patch)
tree2e9851e15290df805793cf6b51d0a0ae0753c195 /src/libutil/str_util.h
parentdc506fc54b60f4bcc7390447a0d80bfd6f799e54 (diff)
downloadrspamd-a45141c003e065341474de0ec0b4310b2f4437c8.tar.gz
rspamd-a45141c003e065341474de0ec0b4310b2f4437c8.zip
[Fix] Properly escape utf8 regexps in hyperscan mode
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r--src/libutil/str_util.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index 100b64b88..ffcc69197 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -396,6 +396,11 @@ rspamd_str_has_8bit (const guchar *beg, gsize len)
gboolean rspamd_normalise_unicode_inplace (rspamd_mempool_t *pool,
gchar *start, guint *len);
+enum rspamd_regexp_escape_flags {
+ RSPAMD_REGEXP_ESCAPE_ASCII = 0,
+ RSPAMD_REGEXP_ESCAPE_UTF = 1u << 0,
+ RSPAMD_REGEXP_ESCAPE_GLOB = 1u << 1,
+};
/**
* Escapes special characters when reading plain data to be processed in pcre
* @param pattern pattern to process
@@ -406,6 +411,6 @@ gboolean rspamd_normalise_unicode_inplace (rspamd_mempool_t *pool,
*/
gchar *
rspamd_str_regexp_escape (const gchar *pattern, gsize slen,
- gsize *dst_len, gboolean allow_glob);
+ gsize *dst_len, enum rspamd_regexp_escape_flags flags);
#endif /* SRC_LIBUTIL_STR_UTIL_H_ */