commit 25870a7: [Minor] Fix missing selector check

moisseev moiseev at mezonplus.ru
Thu Jun 4 16:00:07 UTC 2020


Author: moisseev
Date: 2020-06-04 18:54:41 +0300
URL: https://github.com/rspamd/rspamd/commit/25870a7895e658cc951880dffbb622d39bae9666 (refs/pull/3392/head)

[Minor] Fix missing selector check

---
 rules/controller/selectors.lua | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rules/controller/selectors.lua b/rules/controller/selectors.lua
index 905757c76..bde0cefb0 100644
--- a/rules/controller/selectors.lua
+++ b/rules/controller/selectors.lua
@@ -27,7 +27,7 @@ local function handle_list_extractors(_, conn)
 end
 
 local function handle_check_selector(_, conn, req_params)
-  if req_params.selector then
+  if req_params.selector and req_params.selector ~= '' then
     local selector = lua_selectors.create_selector_closure(rspamd_config,
         req_params.selector, '', true)
       conn:send_ucl({success = selector and true})
@@ -37,7 +37,7 @@ local function handle_check_selector(_, conn, req_params)
 end
 
 local function handle_check_message(task, conn, req_params)
-  if req_params.selector then
+  if req_params.selector and req_params.selector ~= '' then
     local selector = lua_selectors.create_selector_closure(rspamd_config,
         req_params.selector, '', true)
     if not selector then


More information about the Commits mailing list