Page MenuHomePhabricator

D9633.id23110.diff
No OneTemporary

D9633.id23110.diff

diff --git a/externals/jsonlint/src/Seld/JsonLint/JsonParser.php b/externals/jsonlint/src/Seld/JsonLint/JsonParser.php
--- a/externals/jsonlint/src/Seld/JsonLint/JsonParser.php
+++ b/externals/jsonlint/src/Seld/JsonLint/JsonParser.php
@@ -368,12 +368,12 @@
break;
case 16:
$yyval->token = array();
- $property = $tokens[$len][0] === '' ? '_empty_' : $tokens[$len][0];
+ $property = $tokens[$len][0];
$yyval->token[$property] = $tokens[$len][1];
break;
case 17:
$yyval->token = $tokens[$len-2];
- $key = $tokens[$len][0] === '' ? '_empty_' : $tokens[$len][0];
+ $key = $tokens[$len][0];
if (($this->flags & self::DETECT_KEY_CONFLICTS) && array_key_exists($key, $tokens[$len-2])) {
$errStr = 'Parse error on line ' . ($yylineno+1) . ":\n";
$errStr .= $this->lexer->showPosition() . "\n";
diff --git a/src/parser/__tests__/PhutilJSONParserTestCase.php b/src/parser/__tests__/PhutilJSONParserTestCase.php
--- a/src/parser/__tests__/PhutilJSONParserTestCase.php
+++ b/src/parser/__tests__/PhutilJSONParserTestCase.php
@@ -15,6 +15,7 @@
=> array('foo' => 'bar', 'bar' => array('baz')),
'{"foo": "bar", "bar": {"baz": "foo"}}'
=> array('foo' => 'bar', 'bar' => array('baz' => 'foo')),
+ '{"": ""}' => array('' => ''),
);
foreach ($tests as $input => $expect) {

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 10, 5:55 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7386601
Default Alt Text
D9633.id23110.diff (1 KB)

Event Timeline