commit f879e67: [Fix] Another try to fix rspamd_text passing in the selectors

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Sep 22 10:14:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-09-22 11:10:59 +0100
URL: https://github.com/rspamd/rspamd/commit/f879e676a216443d648edffc6d37322001a8994d (HEAD -> master)

[Fix] Another try to fix rspamd_text passing in the selectors
Suggested by: @citrin

---
 lualib/lua_selectors/init.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lualib/lua_selectors/init.lua b/lualib/lua_selectors/init.lua
index 726f7d394..eabf14b27 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
 


More information about the Commits mailing list