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
724134ee
Verified
Commit
724134ee
authored
Mar 03, 2020
by
Cyril Vazquez
Browse files
Unescape
parent
68ff3d22
Pipeline
#7133
canceled with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/Encoding/JsonTokenizer.php
View file @
724134ee
...
@@ -305,9 +305,9 @@ class JsonTokenizer
...
@@ -305,9 +305,9 @@ class JsonTokenizer
*/
*/
protected
function
unescape
(
$string
)
protected
function
unescape
(
$string
)
{
{
$escape
rs
=
array
(
"
\\
"
,
"/"
,
"
\"
"
,
"
\n
"
,
"
\r
"
,
"
\t
"
,
"
\
x08
"
,
"
\
x0c
"
);
$escape
d
=
array
(
'
\\
\\'
,
'\\/'
,
'\\"'
);
//
, "\
\
n", "\
\
r", "\
\
t", "\
\f
", "\
\b
");
$
replacements
=
array
(
"
\\
\\
"
,
"
\\
/"
,
"
\\\"
"
,
"
\
\
n"
,
"
\
\
r"
,
"
\
\
t"
,
"
\
\
f
"
,
"
\
\
b
"
);
$
unescaped
=
array
(
'
\\
'
,
'/'
,
'"'
);
//
, "\n", "\r", "\t", "\
x08
", "\
x0c
");
$result
=
str_replace
(
$
replacements
,
$escape
rs
,
$string
);
$result
=
str_replace
(
$
escaped
,
$
un
escape
d
,
$string
);
return
$result
;
return
$result
;
}
}
...
...
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