changeset 2584:d64fc9c3cffd

mod_firewall: Remove ambiguity from tokens dep parameter
author Matthew Wild <mwild1@gmail.com>
date Sun, 26 Feb 2017 09:50:16 +0000
parents b6b10f57aa56
children 02c6ae745c4f
files mod_firewall/conditions.lib.lua mod_firewall/mod_firewall.lua
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Sun Feb 26 09:49:42 2017 +0000
+++ b/mod_firewall/conditions.lib.lua	Sun Feb 26 09:50:16 2017 +0000
@@ -291,7 +291,7 @@
 	if not (search_name) then
 		error("Error parsing SCAN expression, syntax: SEARCH for PATTERN in LIST");
 	end
-	return ("scan_list(list_%s, %s)"):format(list_name, "tokens_"..search_name.."_"..pattern_name), { "scan_list", "tokens:"..search_name.."_"..pattern_name, "list:"..list_name };
+	return ("scan_list(list_%s, %s)"):format(list_name, "tokens_"..search_name.."_"..pattern_name), { "scan_list", "tokens:"..search_name.."-"..pattern_name, "list:"..list_name };
 end
 
 local valid_comp_ops = { [">"] = ">", ["<"] = "<", ["="] = "==", ["=="] = "==", ["<="] = "<=", [">="] = ">=" };
--- a/mod_firewall/mod_firewall.lua	Sun Feb 26 09:49:42 2017 +0000
+++ b/mod_firewall/mod_firewall.lua	Sun Feb 26 09:50:16 2017 +0000
@@ -237,7 +237,7 @@
 	};
 	tokens = {
 		local_code = function (search_and_pattern)
-			local search_name, pattern_name = search_and_pattern:match("^([^%-]+)_(.+)$");
+			local search_name, pattern_name = search_and_pattern:match("^([^%-]+)-(.+)$");
 			local code = ([[local tokens_%s_%s = {};
 			if search_%s then
 				for s in search_%s:gmatch(pattern_%s) do