Removing slashes which escape quotes inside strings
Publish PHP Package / docker (push) Successful in 5s Details

This commit is contained in:
Pavel Shevaev 2024-03-14 14:33:15 +03:00
parent bf41349ad0
commit 8cbbdd94cb
1 changed files with 5 additions and 2 deletions

View File

@ -249,7 +249,9 @@ class jzonParser
{ {
$end = $this->c; $end = $this->c;
++$this->c; ++$this->c;
return substr($this->in, $start, $end - $start); $str = substr($this->in, $start, $end - $start);
//let's remove escape slashes before "
return str_replace('\\"', '"', $str);
} }
$prev = $this->in[$this->c]; $prev = $this->in[$this->c];
++$this->c; ++$this->c;
@ -351,6 +353,7 @@ function jzon_parse($str)
else else
{ {
$p = new jzonParser($str); $p = new jzonParser($str);
return $p->parse(); $res = $p->parse();
return $res;
} }
} }