diff options
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_config.c | 16 | ||||
-rw-r--r-- | src/lua/lua_task.c | 16 |
2 files changed, 2 insertions, 30 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index d495d0c9e..b574cba59 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -1588,21 +1588,7 @@ lua_config_register_regexp (lua_State *L) } } else { - if (strcmp (type_str, "header") == 0) { - type = RSPAMD_RE_HEADER; - } - else if (strcmp (type_str, "rawheader") == 0) { - type = RSPAMD_RE_RAWHEADER; - } - else if (strcmp (type_str, "mime") == 0) { - type = RSPAMD_RE_MIME; - } - else if (strcmp (type_str, "body") == 0) { - type = RSPAMD_RE_BODY; - } - else if (strcmp (type_str, "url") == 0) { - type = RSPAMD_RE_URL; - } + type = rspamd_re_cache_type_from_string (type_str); if ((type == RSPAMD_RE_HEADER || type == RSPAMD_RE_RAWHEADER) && header_str == NULL) { diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 037337fa8..8246d921b 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2038,21 +2038,7 @@ lua_task_process_regexp (lua_State *L) } } else { - if (strcmp (type_str, "header") == 0) { - type = RSPAMD_RE_HEADER; - } - else if (strcmp (type_str, "rawheader") == 0) { - type = RSPAMD_RE_RAWHEADER; - } - else if (strcmp (type_str, "mime") == 0) { - type = RSPAMD_RE_MIME; - } - else if (strcmp (type_str, "body") == 0) { - type = RSPAMD_RE_BODY; - } - else if (strcmp (type_str, "url") == 0) { - type = RSPAMD_RE_URL; - } + type = rspamd_re_cache_type_from_string (type_str); if ((type == RSPAMD_RE_HEADER || type == RSPAMD_RE_RAWHEADER) && header_str == NULL) { |