Software /
code /
prosody-modules
Comparison
mod_http_muc_log/mod_http_muc_log.lua @ 1560:6c6c1fab4ee5
mod_http_muc_log: Remove unnessesary character from pattern
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Nov 2014 17:15:48 +0100 |
parent | 1559:96f11a1c8b37 |
child | 1561:2eaf4833969a |
comparison
equal
deleted
inserted
replaced
1559:96f11a1c8b37 | 1560:6c6c1fab4ee5 |
---|---|
35 {name} is substituted for values["name"] and is XML escaped | 35 {name} is substituted for values["name"] and is XML escaped |
36 {name!} is substituted without XML escaping | 36 {name!} is substituted without XML escaping |
37 {name?} is optional and is replaced with an empty string if no value exists | 37 {name?} is optional and is replaced with an empty string if no value exists |
38 ]] | 38 ]] |
39 return function(values) | 39 return function(values) |
40 return (data:gsub("{([^!}]-)(%p?)}", function (name, opt) | 40 return (data:gsub("{([^}]-)(%p?)}", function (name, opt) |
41 local value = values[name]; | 41 local value = values[name]; |
42 if value then | 42 if value then |
43 if opt ~= "!" then | 43 if opt ~= "!" then |
44 return st.xml_escape(value); | 44 return st.xml_escape(value); |
45 end | 45 end |