From b3f54531f5c182c693727e71952d5bb1c50571a9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 18 Feb 2016 16:16:49 +0000 Subject: [PATCH] In lua, number cannot be used in boolean context --- src/plugins/lua/spamassassin.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index 988abf011..2367d4572 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -1079,10 +1079,9 @@ local function post_process() local ret = 0 for i, c in ipairs(check) do local match = sa_regexp_match(c, r['re'], raw, r) - if (match and not r['not']) or (not match and r['not']) then + if (match > 0 and not r['not']) or (match == 0 and r['not']) then ret = 1 end - end return ret -- 2.39.5