Cross-posting from: nette/utils#235 (comment)
This code:
str_replace([']]>', '<!'], [']]\x3E', '\x3C!'], $json);
Needs to be:
str_replace([']]>', '<!'], ["]]\x3E", "\x3C!"], $json)
In order to produce valid JSON. Please double-check after me, but when I tried the first version, JSON.parse in the browser complained about an unexpected character because of literal \x3 in there.
Cross-posting from: nette/utils#235 (comment)
This code:
Needs to be:
In order to produce valid JSON. Please double-check after me, but when I tried the first version,
JSON.parsein the browser complained about anunexpected characterbecause of literal\x3in there.