PHP's json_encode has weird forward slash escaping

by jerod.venema 12. December 2009 01:46

OK, we've just uploaded a new version of our PHP publisher and proxy.

We are using the built in json_encode function of PHP (new in version 5.2.1+) to create our JSON strings, and it turns out that there's a bug, or at least a pseudo-bug, in how the json_encode function is implemented. For some reason, they escape forward slashes in the output. This is rather odd, and was the underlying issue that could eventually result in an "invalid json" complaint in our javascript client.

It appears that this issue may be resolved in PHP 5.3+, so those of you running the latest version may not have seen any issues. In either case, the updated scripts should work.

Anyhow, for those of you using WebSync with PHP, grab a new copy of the PHP libraries from our downloads section and you'll be good to go.

Special thanks to Andrew Betts for finding and reporting this one to us.

Tags: ,

Comments

6/12/2010 5:57:06 PM #

mac fonts

Your blog provides us a very great information. Its really very helpful to me to find result on search engine. Hope to hear more good information related to searching from your side.

mac fonts United States | Reply

6/15/2010 10:26:37 PM #

Svitlana.Net.Ua

I would like to thank you for the efforts you have made in writing this post. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now.

Svitlana.Net.Ua United States | Reply

Add comment




  Country flag


  • Comment
  • Preview
Loading