mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
Add strict_mode to paramsPairsDecode
This commit is contained in:
parent
9c1c4eb75b
commit
beea5d2557
1 changed files with 4 additions and 3 deletions
|
|
@ -2669,9 +2669,10 @@ end
|
|||
-- Extracts parameters from a lua table.
|
||||
-- This function performs the inverse conversion of javascript paramsPairsEncode.
|
||||
--
|
||||
-- Note: plain parameters (not encoded with paramsPairsEncode) remain unchanged
|
||||
-- Note: plain parameters (not encoded with paramsPairsEncode) remain unchanged only
|
||||
-- when strict mode is *not* enabled
|
||||
--
|
||||
function paramsPairsDecode(params)
|
||||
function paramsPairsDecode(params, strict_mode)
|
||||
local res = {}
|
||||
|
||||
for k,v in pairs(params) do
|
||||
|
|
@ -2684,7 +2685,7 @@ function paramsPairsDecode(params)
|
|||
end
|
||||
end
|
||||
|
||||
if res[v] == nil then
|
||||
if((not strict_mode) and (res[v] == nil)) then
|
||||
-- this is a plain parameter
|
||||
res[k] = v
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue