comparison mod_firewall/mod_firewall.lua @ 2464:01babf1caa4a

mod_firewall: Fix $<> expressions being truncated when compiled
author Matthew Wild <mwild1@gmail.com>
date Thu, 26 Jan 2017 18:04:59 +0000
parents ef95853cf900
children 3990b1bca308
comparison
equal deleted inserted replaced
2463:e2d955f6167f 2464:01babf1caa4a
62 default = "<undefined>"; 62 default = "<undefined>";
63 end 63 end
64 if expr:match("^@") then 64 if expr:match("^@") then
65 return "\"..(stanza.attr["..("%q"):format(expr:sub(2)).."] or "..("%q"):format(default)..")..\""; 65 return "\"..(stanza.attr["..("%q"):format(expr:sub(2)).."] or "..("%q"):format(default)..")..\"";
66 end 66 end
67 return "\"..(stanza:find("..("%q"):format(expr:sub(2, -2))..") or "..("%q"):format(default)..")..\""; 67 return "\"..(stanza:find("..("%q"):format(expr)..") or "..("%q"):format(default)..")..\"";
68 end) 68 end)
69 :gsub("$$(%a+)", extra or {}) 69 :gsub("$$(%a+)", extra or {})
70 :gsub([[^""%.%.]], "") 70 :gsub([[^""%.%.]], "")
71 :gsub([[%.%.""$]], "")); 71 :gsub([[%.%.""$]], ""));
72 end 72 end