Diff

mod_firewall/actions.lib.lua @ 2125:edf5cf3c474b

mod_firewall: Move meta() function to main module, and make it a global so libs can use it
author Matthew Wild <mwild1@gmail.com>
date Thu, 17 Mar 2016 21:29:07 +0000
parent 2107:f445f43b9ba1
child 2129:26334f4a8eb9
line wrap: on
line diff
--- a/mod_firewall/actions.lib.lua	Thu Mar 17 21:27:24 2016 +0000
+++ b/mod_firewall/actions.lib.lua	Thu Mar 17 21:29:07 2016 +0000
@@ -1,13 +1,7 @@
+--luacheck: globals meta idsafe
 local action_handlers = {};
 
 
--- Run code through this to allow strings to contain code. e.g.: LOG=Received: $(stanza:top_tag())
-local function meta(s, extra)
-	return (s:gsub("$(%b())", [["..tostring(%1).."]])
-		:gsub("$(%b<>)", [["..stanza:find("%1").."]])
-		:gsub("$$(%a+)", extra or {}));
-end
-
 -- Takes an XML string and returns a code string that builds that stanza
 -- using st.stanza()
 local function compile_xml(data)