Fix #66021 (Blank line inside empty JSON array/object)#518
Merged
php-pulls merged 1 commit intophp:PHP-5.4from Apr 14, 2014
plstand:bug66021
Merged
Fix #66021 (Blank line inside empty JSON array/object)#518php-pulls merged 1 commit intophp:PHP-5.4from plstand:bug66021
php-pulls merged 1 commit intophp:PHP-5.4from
plstand:bug66021
Conversation
Changed json_encode() so that when the JSON_PRETTY_PRINT option is specified, the pair of linefeeds immediately after an opening bracket and before the corresponding closing bracket is omitted when the array or object contains no elements or accessible properties (and hence would have a blank line between the brackets).
|
+1 for more readable pretty prints! |
This was referenced Aug 24, 2014
Closed
wmfgerrit
pushed a commit
to wikimedia/mediawiki
that referenced
this pull request
May 31, 2018
The PHP bug 66021 <https://bugs.php.net/bug.php?id=66021> was fixed by php/php-src#518 and is included in PHP 5.4.28+ and PHP 5.5.12+. This workaround is not necessary anymore because the minimum PHP version for MediaWiki is 7.0.0+. Change-Id: I801eaffc253fd88e0d3c87cfe97777837bd3902d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed json_encode() so that when the JSON_PRETTY_PRINT option is specified, the pair of linefeeds immediately after an opening bracket and before the corresponding closing bracket is omitted when the array or object contains no elements or accessible properties (and hence would have a blank line between the brackets).