]> source.dussan.org Git - rspamd.git/commitdiff
In lua, number cannot be used in boolean context
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 18 Feb 2016 16:16:49 +0000 (16:16 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 18 Feb 2016 16:16:49 +0000 (16:16 +0000)
src/plugins/lua/spamassassin.lua

index 988abf01190ece497d91a777cb3bb0b7eade2527..2367d4572d120ab631ce209cb45ec61e2a329f8f 100644 (file)
@@ -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