Branch: Tag:

2001-11-12

2001-11-12 12:27:15 by Anders Johansson <anders@roxen.com>

http_encode_query can now handle multiple values for one variable, given as an array of strings.

Rev: lib/modules/Protocols.pmod/HTTP.pmod/module.pmod:1.27

305:   string http_encode_query(mapping(string:int|string) variables)   {    return Array.map((array)variables, -  lambda(array(string|int) v) +  lambda(array(string|int|array(string)) v)    {    if (intp(v[1]))    return http_encode_string(v[0]); -  +  if (arrayp(v[1])) +  return map(v[1], lambda (string val) { +  return +  http_encode_string(v[0])+"="+ +  http_encode_string(val); +  })*"&";    return http_encode_string(v[0])+"="+    http_encode_string(v[1]);    })*"&";