# HG changeset patch # User Matthew Wild # Date 1487673494 0 # Node ID 1510b66a43fc5242f631ce945451174c20bd4947 # Parent a1b6a6b0aabb4520e73394f0694e4d9171ec3fec mod_firewall: Allow using spaces instead of underscores in actions, as well as conditions diff -r a1b6a6b0aabb -r 1510b66a43fc mod_firewall/mod_firewall.lua --- a/mod_firewall/mod_firewall.lua Tue Feb 21 10:37:53 2017 +0000 +++ b/mod_firewall/mod_firewall.lua Tue Feb 21 10:38:14 2017 +0000 @@ -366,7 +366,7 @@ active_definitions[what] = {}; end active_definitions[what][name] = ret; - elseif line:find("^[^%s:]+[%.=]") then + elseif line:find("^[%w_ ]+[%.=]") then -- Action if state == nil then -- This is a standalone action with no conditions @@ -374,7 +374,7 @@ end state = "actions"; -- Action handlers? - local action = line:match("^[%w_]+"); + local action = line:match("^[%w_ ]+"):upper():gsub(" ", "_"); if not action_handlers[action] then return nil, ("Unknown action on line %d: %s"):format(line_no, action or ""); end