comparison mod_firewall/mod_firewall.lua @ 1001:c0850793b716

mod_firewall: don't use %b() (not technically correct)
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 May 2013 10:43:02 +0100
parents 197af8440ffb
children c66ea26e4224
comparison
equal deleted inserted replaced
1000:8f290d50087f 1001:c0850793b716
284 include_dep(dep, code); 284 include_dep(dep, code);
285 end 285 end
286 local rule_code = table.concat(rule.actions, "\n\t"); 286 local rule_code = table.concat(rule.actions, "\n\t");
287 if #rule.conditions > 0 then 287 if #rule.conditions > 0 then
288 for i, condition in ipairs(rule.conditions) do 288 for i, condition in ipairs(rule.conditions) do
289 local negated = condition:match("^not%b()$"); 289 local negated = condition:match("^not%(.+%)$");
290 if negated then 290 if negated then
291 condition = condition:match("^not%((.+)%)$"); 291 condition = condition:match("^not%((.+)%)$");
292 end 292 end
293 if condition_cache[condition] then 293 if condition_cache[condition] then
294 rule.conditions[i] = (negated and "not(" or "")..condition_cache[condition]..(negated and "_" or ""); 294 rule.conditions[i] = (negated and "not(" or "")..condition_cache[condition]..(negated and "_" or "");