webmcp
view framework/env/request/get_param_strings.lua @ 221:25a20bd1f416
More work on Moonbridge integration: several changes in env/request
author | jbe |
---|---|
date | Wed Feb 25 01:33:27 2015 +0100 (2015-02-25) |
parents | e75abc61d135 |
children | 38e5399718ca |
line source
1 --[[--
2 params =
3 request.get_param_strings()
5 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.
7 --]]--
9 local function merge_params(tbl, params_list)
10 for key, values in pairs(tbl) do
11 if string.match(key, "^_webmcp_") then
12 -- do nothing
13 elseif string.match(key, "%[%]$") then
14 tbl[key] = table.new(values)
15 else
16 tbl[key] = values[1]
17 end
18 end
19 end
21 function request.get_param_strings()
22 local t = {}
23 merge_params(t, request._http_request.get_params_list)
24 merge_params(t, request._http_request.post_params_list)
25 return t
26 end