On Dec 28, 2010, at 3:43 PM, Michele Comitini wrote:
> 
> I thought it was intentional to keep urlencode compat.
> 
> I used to solve it like this:
> 
> vars = (('a',1), ('b',2), ('b',3))

request.vars is a dict already, so it was more straightforward to go the other 
way. Also, I think that's the way that a lot of cgi packages do it (Perl, for 
example, IIRC).

> 
> 
>> There was a fix a little while back, I think, to handle this for incoming 
>> URLs. Sometimes a key appears more than once in a URL query string, like 
>> this:
>> 
>>        http://domain.com/a/b/c?a=1&b=2&b=3
>> 
>> A typical place this happens is for form checkboxes, where the same key 
>> (associated with the group of checkboxes) gets sent once for each box that's 
>> checked.
>> 
>> This shows up in request.vars as a list, so the above ends up being 
>> something like:
>> 
>>        vars = dict(a=1, b=[2,3])
>> 
>> ...except that they're strings.
>> 
>> The problem was that this wasn't being handled for outgoing URLs (in URL()), 
>> so if you tried to send the example above you'd get something like:
>> 
>>        http://domain.com/a/b/c?a=1&b=[2, 3]
>> 
>> ...which isn't right. The fix is to generate a URL that looks like the first 
>> example above.
>> 
>> This fix is also incorporated into the recent hmac signature checking of 
>> immutable vars.


Reply via email to