From: Vsevolod Stakhov Date: Wed, 22 Sep 2021 10:10:59 +0000 (+0100) Subject: [Fix] Another try to fix rspamd_text passing in the selectors X-Git-Tag: 3.1~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f879e676a216443d648edffc6d37322001a8994d;p=thirdparty%2Frspamd.git [Fix] Another try to fix rspamd_text passing in the selectors Suggested by: @citrin --- diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua index 726f7d394e..eabf14b277 100644 --- a/lualib/lua_selectors/init.lua +++ b/lualib/lua_selectors/init.lua @@ -57,7 +57,7 @@ local function implicit_tostring(t, ud_or_table) end return logger.slog("%s", ud_or_table),'string' - elseif t == 'userdata' then + elseif (t == 'string' or t == 'text') and type(ud_or_table) == 'userdata' then if ud_or_table.cookie and ud_or_table.cookie == text_cookie then -- Preserve opaque return ud_or_table,'string' @@ -73,7 +73,7 @@ end local function process_selector(task, sel) local function allowed_type(t) - if t == 'string' or t == 'text' or t == 'string_list' or t == 'text_list' then + if t == 'string' or t == 'string_list' then return true end