Verified Commit 99846ef3 authored by Alexandre Morin's avatar Alexandre Morin
Browse files

fix (13377) : update regex on jsonTokenizer

parent 7b1a6a47
Pipeline #7121 failed with stages
...@@ -213,9 +213,8 @@ class JsonTokenizer ...@@ -213,9 +213,8 @@ class JsonTokenizer
do { do {
$chunk = fread($this->stream, $this->threshold); $chunk = fread($this->stream, $this->threshold);
$length = strlen($chunk); $length = strlen($chunk);
if (preg_match('#^[^"\\\\]*(?:\\\\.[^"\\\\]*)*"#', $chunk, $matches)) { if (preg_match('/(?<!\\\\)(?:\\\\{2})*\\K"/', $chunk, $matches, PREG_OFFSET_CAPTURE)) {
$tail = substr($matches[0], 0, -1); $tail = substr($chunk, 0, $matches[0][1]);
$end = strlen($tail); $end = strlen($tail);
$size += $end; $size += $end;
fwrite($buffer, $tail); fwrite($buffer, $tail);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment