Protect -{...}- variant constructs in images.
authorC. Scott Ananian <cscott@cscott.net>
Tue, 13 Dec 2016 19:49:36 +0000 (14:49 -0500)
committerTim Starling <tstarling@wikimedia.org>
Tue, 20 Dec 2016 22:08:36 +0000 (22:08 +0000)
commit51d54b4b9150c32dec88e76e25ed90c3f026281d
tree604871748265f7924b8051854d2f05a1b774a9e3
parent272c029ed992dc7fcbc5146f6dd9ec6d543977f4
Protect -{...}- variant constructs in images.

A protected version of explode is factored out as
`StringUtils::delimiterExplode`, since it will be used in follow-up
patches in this series.  The `delimiterExplode` implementation creates
an intermediate array of the exploded results, which is reasonable as
the number of image options is small; but since an Iterator is
returned the implementation can be upgraded in the future (at the cost
of additional complexity) to avoid this.  The additional code in that
case would be similar to ExplodeIterator.

Bug: T146305
Change-Id: I1327685e9e8c07ef476dceaa6f6dae4ba40989ef
includes/libs/StringUtils.php
includes/parser/Parser.php
tests/parser/parserTests.txt