From: Vsevolod Stakhov Date: Thu, 18 Feb 2016 16:16:49 +0000 (+0000) Subject: In lua, number cannot be used in boolean context X-Git-Tag: 1.2.0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3f54531f5c182c693727e71952d5bb1c50571a9;p=thirdparty%2Frspamd.git In lua, number cannot be used in boolean context --- diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index 988abf0119..2367d4572d 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