diff mod_firewall/conditions.lib.lua @ 2363:12b78170b76c

mod_firewall: INSPECT: Handle stanza:find() returning nil (i.e. path didn't match)
author Matthew Wild <mwild1@gmail.com>
date Tue, 15 Nov 2016 14:58:16 +0000
parents c065ab67d807
children 00eed68f63bf
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Tue Nov 15 14:57:40 2016 +0000
+++ b/mod_firewall/conditions.lib.lua	Tue Nov 15 14:58:16 2016 +0000
@@ -116,7 +116,7 @@
 			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("(.-)~=(.*)"));
+			return ("(stanza:find(%q) or ''):match(%q)"):format(path:match("(.-)~=(.*)"));
 		else
 			return ("stanza:find(%q) == %q"):format(path:match("(.-)=(.*)"));
 		end