[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] org.conman.parsers.url 2.0.2 released
- From: Stefan <ste@...>
- Date: Fri, 5 Jun 2020 14:30:38 +0200
Am 05.06.2020 um 06:34 schrieb Philippe Verdy:
> I also agree: the URL-encoding of parameters in the query string is
> just a convention
>
> Also a simple table would break with a query string like "?q=1&q=2&r=3"
> which is also legal:
> - If you represent it as a table it cannot be {"q" = "1"; "q" = "2"; "r"
> = "3"}, which is legal in Lua syntax but as the effect of overriding the
> key "q" with a second assignment so you just get {"q"="2";"r"="3"}
> - if you use a table of tables, it becomes: {"q" = {"1", "2"}; "r" =
> {"3"}} which preserves all values (note that the MIME encoding typically
> used for POST contents also allow duplicate assignments to the same
> parameter name, so these names are subindexed by a sequence number and
> for POST contents, there are several encodings possible: the posted
> parameters could use many other encodings, including some binary data in
> many supported formats (as indicated by the MIME type, and with the help
> of the transport syntax).
Browsers produce q=1&q=2 for checkboxes in forms.
PHP uses another convention to recognize arrays: ?q[]=1&q[]=2
But it is little known and breaks many scripts that expect only string
parameters.