<![CDATA[ Trouble with site after upgrade JSON no longer working - My Forums]]> https://forums.modx.com/thread/?thread=83400 <![CDATA[Re: Trouble with site after upgrade JSON no longer working]]> https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-461944
I can understand that. I'm just glad I found it to correct it. I'll try and remember about the command when 1.0.10 is released.]]>
BBloke Apr 06, 2013, 03:30 AM https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-461944
<![CDATA[Re: Trouble with site after upgrade JSON no longer working]]> https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-461819
Sorry for that change, but entity encoding of MODX tags seems the best way for me to get rid of the hassles with displaying not stripped MODX tags from GPC for several reasons.

$modx->stripTags don't remove half MODX tags like in '[[Ditto &parents=`0` &test=`' and that could cause issues if this string is displayed followed by a second output with half closing tags like in '`]]'. MODX tags could be divided by i.e. html tags like in '[<b>[Ditto? &parents=`0` &test=`' and if those html tags are stripped by $modx->stripTags a valid half MODX tag is displayed.

Those entity encoded MODX tags are safe for most cases, they only cause that issue that you have discovered by posting JSON strings.]]>
Jako Apr 05, 2013, 06:51 AM https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-461819
<![CDATA[Re: Trouble with site after upgrade JSON no longer working]]> https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-461803
I had to wrap my command in html_entity_decode!!! Even though it looked ok in FF Chrome showed the way on what was being sent.

$data = json_decode(html_entity_decode(stripslashes($_POST['data'])));

Chris]]>
BBloke Apr 05, 2013, 05:26 AM https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-461803
<![CDATA[Re: Trouble with site after upgrade JSON no longer working]]> https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-460163 Jako Mar 25, 2013, 12:20 PM https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-460163 <![CDATA[Trouble with site after upgrade JSON no longer working]]> https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-460070
I've recently updated my site to 1.0.9 and put the hot fix in place. I've noticed that one of my pages which uses AJAX and JSON has stopped working.

It's been difficult to debug and there is little information from modx but it seems as the json_decode isn't performing what is needed. I can only put this down to the site update as I haven't change the code in some time.

I've checked my JSON code with an online parser and everything is fine however the foreach loop against each json item just fails against "undefined property".

Would anyone be able to help with this?

Cheers,
BBloke]]>
BBloke Mar 25, 2013, 05:24 AM https://forums.modx.com/thread/83400/trouble-with-site-after-upgrade-json-no-longer-working#dis-post-460070