From bf4c035dbb9bfccabc841f4588370fca63b65720 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 8 Mar 2018 21:26:47 -0800 Subject: [PATCH] Add new mode for known single-value inputs --- web-lib-funcs.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web-lib-funcs.pl b/web-lib-funcs.pl index 89cb4f4df..5a7bc123e 100755 --- a/web-lib-funcs.pl +++ b/web-lib-funcs.pl @@ -537,7 +537,7 @@ and store it in the global %in hash. The optional parameters are : =item cbargs - Additional parameters to the callback function. -=item array-mode - Values in %in are arrays, not strings joined with \0 +=item array-mode - If set to 1, values in %in are arrays. If set to 0, multiple values are joined with \0. If set to 2, only the first value is used. =cut sub ReadParseMime @@ -588,10 +588,13 @@ while(1) { if ($1 eq "filename") { $file = $2; } - if ($arrays) { + if ($arrays == 1) { $in{$foo} ||= []; push(@{$in{$foo}}, $2); } + elsif ($arrays == 2) { + $in{$foo} ||= $2; + } else { $in{$foo} .= "\0" if (defined($in{$foo}));