Changeset

2073:de15606f3669

mod_firewall: Verify that JID part exists before attempting to call method
author Kim Alvefur <zash@zash.se>
date Fri, 11 Mar 2016 18:18:04 +0100
parents 2072:eda5c54dfa30
children 2074:86427261e3c4
files mod_firewall/conditions.lib.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_firewall/conditions.lib.lua	Fri Mar 11 18:16:38 2016 +0100
+++ b/mod_firewall/conditions.lib.lua	Fri Mar 11 18:18:04 2016 +0100
@@ -33,7 +33,7 @@
 		else
 			pattern = pattern:gsub("%p", "%%%0"):gsub("%%(%p)", wildcard_equivs);
 		end
-		return ("%s:match(%q)"):format(part, "^"..pattern.."$");
+		return ("(%s and %s:match(%q))"):format(part, part, "^"..pattern.."$");
 	else
 		return ("%s == %q"):format(part, match);
 	end