# HG changeset patch # User jbe # Date 1350313447 -7200 # Node ID 66bdd686df306ff9fa9bd4a66eab90a755fd07d0 # Parent c92bd1ec1130c1efd1e10e3fd4a8c968b7e7c1a1 request.get_param_strings() returns table which may be modified without side-effects diff -r c92bd1ec1130 -r 66bdd686df30 framework/env/request/get_param_strings.lua --- a/framework/env/request/get_param_strings.lua Mon Oct 15 16:57:39 2012 +0200 +++ b/framework/env/request/get_param_strings.lua Mon Oct 15 17:04:07 2012 +0200 @@ -2,10 +2,18 @@ params = param.get_param_strings() -This function returns a table with all raw GET/POST parameters as strings or list of strings (except internal parameters like "_webmcp_path" or "_webmcp_id"). The returned table must not be modified. +This function returns a table with all raw GET/POST parameters as strings or list of strings (except internal parameters like "_webmcp_path" or "_webmcp_id"). Modifications of the returned table have no side effects. --]]-- function request.get_param_strings() - return request._params + local t = {} + for key, value in pairs(request._params) do + if type(request._params) == 'table' then + t[key] = table.new(value) + else + t[key] = value + end + end + return t end