Support

Account

Home Forums General Issues Forward slashes escaped in JSON

Solved

Forward slashes escaped in JSON

  • I think this is a bug. I have a textarea in wp-admin, based on ACF. When I enter three lines, I get the following JSON:

    {"somed":"<h2>Thing<\/h2>\n<h1>Interesting<\/h1>\n<p>Expiring<\/p>\n"}

    As you can see, <\/h2> is not valid. It seems like there is a bug.

    How can we get this fixed?

  • This is how your cone is represented in JSON.

    Do this somewhere echo json_encode('<h1>Some Text</h1>');

    and you will see that the output is "<h1>Some Text<\/h1>"

    special characters must be escaped in json

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.