Compare commits

..

No commits in common. "master" and "master" have entirely different histories.

1 changed files with 2 additions and 10 deletions

View File

@ -47,10 +47,6 @@ 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 ];
} }
@ -68,10 +64,6 @@ 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 ];
} }
@ -127,7 +119,7 @@ class JSONStream
$v = $this->readToken(); $v = $this->readToken();
} while (count($this->in) > $n); } while (count($this->in) > $n);
$value = $v; $value = $v;
return true; return ($this->in[count($this->in)-1][0] == 1);
} }
public function unreadBuffer() public function unreadBuffer()
@ -232,7 +224,7 @@ class JSONStream
$this->offset += strlen($m[0]); $this->offset += strlen($m[0]);
if ($m[0][0] == "\\") if ($m[0][0] == "\\")
{ {
if ($m[0][1] == 'u') if ($m[0] == 'u')
$v .= mb_convert_encoding(pack('H*', str_replace('\\u', '', $m[0])), 'UTF-8', 'UTF-16BE'); $v .= mb_convert_encoding(pack('H*', str_replace('\\u', '', $m[0])), 'UTF-8', 'UTF-16BE');
else else
{ {