HomePhabricator

Standardise URI query formatting

This commit no longer exists in the repository. It may have been part of a branch which was deleted.This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

Description

Standardise URI query formatting

This patch standardises URI queries in the mw.uri library so that they
have the same formatting as URI queries generated from PHP. In
particular:

  1. For duplicate keys, mw.uri.buildQueryString now produces foo[0]=bar&foo[1]=baz, instead of foo=bar&foo=baz. (The square brackets are URI-encoded.)
  2. mw.uri.buildQueryString can now handle nested query tables. mw.uri.buildQueryString{ foo = { bar = { baz = 'qux' } } } will now produce "foo[bar][baz]=qux". (Again, square brackets are URI-encoded.)
  3. mw.uri.parseQueryString can now handle keys like "foo[]", "foo[0]" and "foo[bar][baz]".
  4. Query arrays passed to PHP from Lua are normalised to start at 0, not 1.

Bug: T93059
Bug: T105851
Change-Id: I3ed9529deb7a63dbabdc58d7afb3b0cea9307a7f

Details

Provenance
MrStradivariusAuthored on Mar 25 2015, 8:24 AM
ChangeId
I3ed9529deb7a63dbabdc58d7afb3b0cea9307a7f

Commit No Longer Exists

This commit no longer exists in the repository.