mod_firewall/conditions.lib.lua
changeset 2366 c065ab67d807
parent 2346 6848297cf40a
child 2367 12b78170b76c
--- a/mod_firewall/conditions.lib.lua	Tue Nov 15 09:01:03 2016 +0100
+++ b/mod_firewall/conditions.lib.lua	Tue Nov 15 14:57:40 2016 +0000
@@ -112,6 +112,9 @@
 function condition_handlers.INSPECT(path)
 	if path:find("=") then
 		local query, is_pattern_match, value = path:match("(.-)(~?)=(.*)");
+		if not(query:match("#$") or query:match("@[^/]+")) then
+			error("Stanza path does not return a string (append # for text content or @name for value of named attribute)", 0);
+		end
 		if is_pattern_match ~= "" then
 			return ("stanza:find(%q):match(%q)"):format(path:match("(.-)~=(.*)"));
 		else