[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2012-07-19 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

Mark Holmquist  changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 CC||mtrac...@member.fsf.org
 Resolution||FIXED

--- Comment #8 from Mark Holmquist  2012-07-19 
21:15:51 UTC ---
This appears to be very resolved. mw.Uri now handles multiple arguments as an
array, properly. Also, while I cannot find the relevant code, there is a commit
message that says something about more-PHP-like array handling.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2011-09-14 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

Neil Kandalgaonkar  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |

--- Comment #7 from Neil Kandalgaonkar  2011-09-15 
01:23:40 UTC ---
Okay, actually, maybe it would be a good idea to handle all that with
$.param(), and there is a decently documented function in jQuery BBQ which
unserializes URLs much like $.param(), even for complex values like
?foo[a][b]=var .

However, now I remember why I didn't use $.param(); we like to escape things
differently (for whatever reason we always escape parentheses, for example).

Looking into whether I can fiddle with jQuery's escaping routines there.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2011-09-14 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

Neil Kandalgaonkar  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #6 from Neil Kandalgaonkar  2011-09-15 
00:01:01 UTC ---
This bug is resolved, just was lazy about marking it. The migration to core has
obscured history a bit but see lines 169-176, or look at r83691. As for
compatibility with what PHP wants to see that seems to be a matter of the
application doing the right thing when constructing the URI. It is not a given
that all URIs constructed with this module are supposed to be consumed by
MediaWiki or PHP.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2011-09-14 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

Brion Vibber  changed:

   What|Removed |Added

 CC||tpars...@wikimedia.org
  Component|UploadWizard|Javascript
Version|any |1.19-svn
Product|MediaWiki extensions|MediaWiki

--- Comment #5 from Brion Vibber  2011-09-14 23:38:37 UTC 
---
Moving bug out of UploadWizard to core, as this JS module has migrated into
core.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2011-09-14 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

--- Comment #4 from Brion Vibber  2011-09-14 23:34:32 UTC 
---
It is permissible to have an argument appear multiple times, however *unless
its name ends in "[]" PHP will just overwrite all the earlier ones with the
later ones when it interprets input.

Query string / POST elements whose names end in '[]' or '[]' produce
array elements, which may have either numeric or string keys.

If you have [] on the end of the name, then it saves the one-or-more elements
into an array with the name without the [].

Within MediaWiki we fairly consistently use the associative-array model here,
with sub-arrays for multiple items getting the [] added on the generated URL:

> parse_str('a[]=b&a[]=c', $foo); var_export($foo);
array (
  'a' => 
  array (
0 => 'b',
1 => 'c',
  ),
)
> parse_str('a[xx]=b&a[yy]=c', $foo); var_export($foo);
array (
  'a' => 
  array (
'xx' => 'b',
'yy' => 'c',
  ),
)

> return wfArrayToCGI(array('a' => array('b', 'c')));
a%5B0%5D=b&a%5B1%5D=c

> return wfArrayToCGI(array('a' => array('xx' => 'b', 'yy' => 'c')));
a%5Bxx%5D=b&a%5Byy%5D=c

mw.Uri should probably model these similarly... $.param already seems to do
this for serializing parameters into query strings:

>>> $.param({a: "b"});
"a=b"

>>> $.param({a: ["b", "c"]});
"a%5B%5D=b&a%5B%5D=c"

>>> $.param({a: {xx: "b", yy: "c"}});
"a%5Bxx%5D=b&a%5Byy%5D=c"

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2011-03-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

--- Comment #2 from Neil Kandalgaonkar  2011-03-08 
19:55:55 UTC ---
Krinkle: no, that's not correct -- in the HTTP standard it is permissible to
have multiple values for a key in the query string, and they all count. 

In HTML, this can result from submitting a form with a SELECT with the MULTIPLE
attribute on, so you can select multiple values.

Or are you saying that something in MediaWiki parses URLs that way? If so it's
wrong.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l


[Bug 27942] make mw.Uri.js handle query arguments that appear multiple times

2011-03-08 Thread bugzilla-daemon
https://bugzilla.wikimedia.org/show_bug.cgi?id=27942

Krinkle  changed:

   What|Removed |Added

 CC||krinklem...@gmail.com

--- Comment #1 from Krinkle  2011-03-08 19:35:37 UTC ---
More precise, it needs to return the last one (since that one overwrites the
earlier one).
Most regexes around (haven't looked into mw.Uri.js), stop at the first match.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are on the CC list for the bug.

___
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l