Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15453736
D9633.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9633.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 30, 1:59 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7386601
Default Alt Text
D9633.diff (1 KB)
Attached To
Mode
D9633: Fix the handling of empty keys in `PhutilJSONParser`.
Attached
Detach File
Event Timeline
Log In to Comment