Last modified: 2014-04-29 14:13:08 UTC
Instead, of the current syntax, of having array-type attributes defined as key=val1|val2 etc... The normal behavior for a HTTP GET query string is key=val1&key=val2 etc... i.e. they key is duplicated for each value.
What standard specifies this as the normal behavior?
Just noticed, that for php to accept multiple same names, they must be followed by a [], as in: <form method="get"> <input type="checkbox" value="a" name="foo[]" /><label for="foo">Foo</label><br/> <input type="checkbox" value="b" name="foo[]" /><label for="bar">Bar</label><br/> <input type="checkbox" value="c" name="foo[]" /><label for="baz">Baz</label><br/> <input type="submit"/> </form> which will generate: test.php?foo%5B%5D=a&foo%5B%5D=b&foo%5B%5D=c and an array: Array ( [foo] => Array ( [0] => a [1] => b [2] => c ) ) from $_GET perhaps this would be too cumbersome for the api.
Consider what this would mean when requesting a hundred titles: api.php?action=query&prop=info&titles[]=a&titles[]=b&titles[]=c&... versus: api.php?action=query&prop=info&titles=a|b|c|... The query string using the titles[] approach grows very long very quickly. Besides, converting an array to the a|b|c format is very easy with PHP's implode function.
(In reply to comment #3) > Consider what this would mean when requesting a hundred titles: > > api.php?action=query&prop=info&titles[]=a&titles[]=b&titles[]=c&... > > versus: > > api.php?action=query&prop=info&titles=a|b|c|... > > The query string using the titles[] approach grows very long very quickly. > Besides, converting an array to the a|b|c format is very easy with PHP's > implode function. > In that you are right. :)
*** Bug 48903 has been marked as a duplicate of this bug. ***