Software /
code /
prosody-modules
Diff
mod_storage_appendmap/mod_storage_appendmap.lua @ 2430:a2625a36c092
mod_storage_appendmap: Fix pattern meant to match valid Lua Names so such are escaped correctly
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 02 Jan 2017 21:03:56 +0100 |
parent | 2205:98354fbea63c |
child | 2431:623e23190c3e |
line wrap: on
line diff
--- a/mod_storage_appendmap/mod_storage_appendmap.lua Mon Jan 02 20:10:37 2017 +0100 +++ b/mod_storage_appendmap/mod_storage_appendmap.lua Mon Jan 02 21:03:56 2017 +0100 @@ -36,7 +36,7 @@ end for key, value in pairs(keyvalues) do module:log("debug", "user %s sets %q to %s", user, key, tostring(value)) - if type(key) ~= "string" or not key:find("^[%w_][%w%d_]*$") or key == "_ENV" then + if type(key) ~= "string" or not key:find("^[%a_][%w_]*$") or key == "_ENV" then key = "_ENV[" .. dump(key) .. "]"; end table.insert(keys, key);