Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Maarch
maarchRM
Commits
99846ef3
Verified
Commit
99846ef3
authored
Mar 02, 2020
by
Alexandre Morin
Browse files
fix (13377) : update regex on jsonTokenizer
parent
7b1a6a47
Pipeline
#7121
failed with stages
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
core/Encoding/JsonTokenizer.php
View file @
99846ef3
...
...
@@ -213,9 +213,8 @@ class JsonTokenizer
do
{
$chunk
=
fread
(
$this
->
stream
,
$this
->
threshold
);
$length
=
strlen
(
$chunk
);
if
(
preg_match
(
'#^[^"\\\\]*(?:\\\\.[^"\\\\]*)*"#'
,
$chunk
,
$matches
))
{
$tail
=
substr
(
$matches
[
0
],
0
,
-
1
);
if
(
preg_match
(
'/(?<!\\\\)(?:\\\\{2})*\\K"/'
,
$chunk
,
$matches
,
PREG_OFFSET_CAPTURE
))
{
$tail
=
substr
(
$chunk
,
0
,
$matches
[
0
][
1
]);
$end
=
strlen
(
$tail
);
$size
+=
$end
;
fwrite
(
$buffer
,
$tail
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment