FormatJson: Remove whitespace from empty arrays and objects
authorKevin Israel <pleasestand@live.com>
Tue, 8 Oct 2013 21:23:06 +0000 (17:23 -0400)
committerTimo Tijhof <krinklemail@gmail.com>
Wed, 9 Oct 2013 02:13:31 +0000 (04:13 +0200)
commitb6a5bb484d90c6705bd1b010efcc2c1c18be1f34
tree1bc1b5638c898e28da3e0163a962b447f15e38b8
parent39e22628f7c8dfeaff522c6a0ca06c0899743ff7
FormatJson: Remove whitespace from empty arrays and objects

As noted in c370ad21d7f8, the pretty output can differ between
Zend PHP and HHVM. This change adds some post-processing to make
the output consistent across implementations and with JavaScript
JSON.stringify() and Python json.dumps(); all whitespace between
the opening and closing brackets/braces is removed.

Change-Id: I490e0ff1fac3d6c3fb44ab127e432872c0301a9d
includes/json/FormatJson.php
tests/phpunit/includes/json/FormatJsonTest.php