Browse Source

Fix handling of empty arrays and objects

pull/3/head
Markus Mittendrein 1 year ago
parent
commit
8607a7f516
  1. 8
      JSONStream.php

8
JSONStream.php

@ -47,6 +47,10 @@ class JSONStream
$this->offset++;
$this->skipWhitespace();
$st = $this->buffer[$this->offset] === '}' ? 2 : 1;
if ($st == 2)
{
$this->offset++;
}
$this->in[] = [ $st, self::OBJ, NULL, false ];
}
@ -64,6 +68,10 @@ class JSONStream
$this->offset++;
$this->skipWhitespace();
$st = $this->buffer[$this->offset] === ']' ? 2 : 1;
if ($st == 2)
{
$this->offset++;
}
$this->in[] = [ $st, self::ARR, NULL, false ];
}

Loading…
Cancel
Save