Software /
code /
prosody-modules
Comparison
mod_firewall/definitions.lib.lua @ 2528:44a71584521d
mod_firewall: Add SEARCH, PATTERN definitions and SCAN condition to check tokenized stanza:find() against a list
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 20 Feb 2017 09:31:30 +0000 |
parent | 2523:a3a18d09ae8a |
child | 2530:84e103fd8039 |
comparison
equal
deleted
inserted
replaced
2527:5ff7eb601d60 | 2528:44a71584521d |
---|---|
168 end | 168 end |
169 end | 169 end |
170 return create_list(list_backend, list_definition:match("^%S+"), opts); | 170 return create_list(list_backend, list_definition:match("^%S+"), opts); |
171 end | 171 end |
172 | 172 |
173 function definition_handlers.PATTERN(name, pattern) | |
174 local ok, err = pcall(string.match, "", pattern); | |
175 if not ok then | |
176 error("Invalid pattern '"..name.."': "..err); | |
177 end | |
178 return pattern; | |
179 end | |
180 | |
181 function definition_handlers.SEARCH(name, pattern) | |
182 return pattern; | |
183 end | |
184 | |
173 return definition_handlers; | 185 return definition_handlers; |