diff mod_firewall/mod_firewall.lua @ 2404:9af2d36567a8

mod_firewall: Allow conditions to end with a question mark
author Kim Alvefur <zash@zash.se>
date Fri, 02 Dec 2016 11:45:10 +0100
parents 2040330586e4
children 9159f9166893
line wrap: on
line diff
--- a/mod_firewall/mod_firewall.lua	Wed Nov 30 15:44:35 2016 +0100
+++ b/mod_firewall/mod_firewall.lua	Fri Dec 02 11:45:10 2016 +0100
@@ -305,7 +305,7 @@
 			end
 			-- Check standard modifiers for the condition (e.g. NOT)
 			local negated;
-			local condition = line:match("^[^:=%.]*");
+			local condition = line:match("^[^:=%.?]*");
 			if condition:find("%f[%w]NOT%f[^%w]") then
 				local s, e = condition:match("%f[%w]()NOT()%f[^%w]");
 				condition = (condition:sub(1,s-1)..condition:sub(e+1, -1)):match("^%s*(.-)%s*$");