]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix virtual symbols registration as parent now supports just ids
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Apr 2018 18:45:02 +0000 (19:45 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Apr 2018 18:45:02 +0000 (19:45 +0100)
src/plugins/lua/antivirus.lua

index ff64618cbe6d00c95393d2ca1a790ff5bb50371f..4fb683c415a292cde9fec3698da3e521504b837b 100644 (file)
@@ -846,7 +846,7 @@ if opts and type(opts) == 'table' then
       if not cb then
         rspamd_logger.errx(rspamd_config, 'cannot add rule: "' .. k .. '"')
       else
-        rspamd_config:register_symbol({
+        local id = rspamd_config:register_symbol({
           type = 'normal',
           name = m['symbol'],
           callback = cb,
@@ -854,7 +854,7 @@ if opts and type(opts) == 'table' then
         rspamd_config:register_symbol({
           type = 'virtual',
           name = m['symbol_fail'],
-          parent = m['symbol'],
+          parent = id,
           score = 0.0,
         })
         has_valid = true
@@ -876,7 +876,7 @@ if opts and type(opts) == 'table' then
               rspamd_config:register_symbol({
                 type = 'virtual',
                 name = sym,
-                parent = m['symbol']
+                parent = id
               })
             end
           end