Unescape

parent 68ff3d22
Pipeline #7133 canceled with stages
......@@ -305,9 +305,9 @@ class JsonTokenizer
*/
protected function unescape($string)
{
$escapers = array("\\", "/", "\"", "\n", "\r", "\t", "\x08", "\x0c");
$replacements = array("\\\\", "\\/", "\\\"", "\\n", "\\r", "\\t", "\\f", "\\b");
$result = str_replace($replacements, $escapers, $string);
$escaped = array('\\\\', '\\/', '\\"');//, "\\n", "\\r", "\\t", "\\f", "\\b");
$unescaped = array('\\', '/', '"');//, "\n", "\r", "\t", "\x08", "\x0c");
$result = str_replace($escaped, $unescaped, $string);
return $result;
}
......
Markdown is supported
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