Fix handling of empty arrays and objects
parent
4193dbb96c
commit
8607a7f516
|
@ -47,6 +47,10 @@ class JSONStream
|
||||||
$this->offset++;
|
$this->offset++;
|
||||||
$this->skipWhitespace();
|
$this->skipWhitespace();
|
||||||
$st = $this->buffer[$this->offset] === '}' ? 2 : 1;
|
$st = $this->buffer[$this->offset] === '}' ? 2 : 1;
|
||||||
|
if ($st == 2)
|
||||||
|
{
|
||||||
|
$this->offset++;
|
||||||
|
}
|
||||||
$this->in[] = [ $st, self::OBJ, NULL, false ];
|
$this->in[] = [ $st, self::OBJ, NULL, false ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +68,10 @@ class JSONStream
|
||||||
$this->offset++;
|
$this->offset++;
|
||||||
$this->skipWhitespace();
|
$this->skipWhitespace();
|
||||||
$st = $this->buffer[$this->offset] === ']' ? 2 : 1;
|
$st = $this->buffer[$this->offset] === ']' ? 2 : 1;
|
||||||
|
if ($st == 2)
|
||||||
|
{
|
||||||
|
$this->offset++;
|
||||||
|
}
|
||||||
$this->in[] = [ $st, self::ARR, NULL, false ];
|
$this->in[] = [ $st, self::ARR, NULL, false ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue