FormatJson::stripComments
authorBryan Davis <bd808@wikimedia.org>
Sun, 12 Oct 2014 17:59:00 +0000 (11:59 -0600)
committerBryan Davis <bd808@wikimedia.org>
Sun, 12 Oct 2014 18:34:22 +0000 (12:34 -0600)
commit8fea9c619d07deafee54763dfe20538406a9bf13
tree5bf883cf6a543815776c0083cb6c4f6f25cbf0c7
parent042c6b6fccb137a6b0d1a05edc523b236f85caaf
FormatJson::stripComments

Add stripComments method that can be used to remove single line and
multiline comments from an otherwise valid JSON string. Inspired by the
comment removal code in redisJobRunnerService and discussions on irc
about the Extension registration RFC.

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