Mercurial > prosody-modules
diff mod_firewall/conditions.lib.lua @ 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 | eda5c54dfa30 |
children | 86427261e3c4 |
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