From 5e134e4975fc674a2adfd3e893f2eba49a7bc292 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 22 Sep 2011 10:20:27 -0400 Subject: [PATCH] Tpac: better param array detection in mkurl() Avoid propagating empty arrays as "ARRAY(JUNK)" Signed-off-by: Bill Erickson --- Open-ILS/src/templates/opac/parts/header.tt2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/opac/parts/header.tt2 b/Open-ILS/src/templates/opac/parts/header.tt2 index 66e47ac7c0..e6addc88c1 100644 --- a/Open-ILS/src/templates/opac/parts/header.tt2 +++ b/Open-ILS/src/templates/opac/parts/header.tt2 @@ -43,7 +43,9 @@ # apply user params FOR k IN params.keys; encoded = []; - list = params.$k.0 ? params.$k : [params.$k]; + max = params.$k.max; + list = (params.$k.0 OR max == -1) ? params.$k : [params.$k]; + IF list.size == 0; NEXT; END; # CGI croaks on already-decoded strings. force-encode to be safe. FOR p IN list; encoded.push(ctx.encode_utf8(p)); END; foo = cgi.param("-name", k, "-values", encoded); -- 2.11.0