mod_storage_appendmap: Fix pattern meant to match valid Lua Names so such are escaped correctly
authorKim Alvefur <zash@zash.se>
Mon, 02 Jan 2017 21:03:56 +0100
changeset 2434 a2625a36c092
parent 2433 0b3c7b03cb90
child 2435 623e23190c3e
mod_storage_appendmap: Fix pattern meant to match valid Lua Names so such are escaped correctly
mod_storage_appendmap/mod_storage_appendmap.lua
--- 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);