Joomla 2.5 and php 5.4 (JSON_UNESCAPED_SLASHES)

604 views
Skip to first unread message

Rob Stocker

unread,
Jun 27, 2012, 1:09:56 PM6/27/12
to joomla-dev-general
Hi All,

I just updated to php5.4 so I could use :

echo json_encode($result, JSON_UNESCAPED_SLASHES); 

And the site broke.
(the main toolbar disappears amongst other things- Admin side)

I need to either make joomla work with php5.4 or find an alternative to the unescaped slashes parameter.

I'm using json_encode to return a div with content  but the forward slashes get escaped.

eg  <div>stuff </div>

becomes

<div>stuff <\/div>

Any hints?


--
Rob & Lisa - EMC23
083 416 0618
in...@emc23.com
www.emc23.com

Justin Kelly

unread,
Jun 27, 2012, 2:01:20 PM6/27/12
to joomla-de...@googlegroups.com

look up preg_replace() on php.net

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

Rob Stocker

unread,
Jun 27, 2012, 2:10:53 PM6/27/12
to joomla-de...@googlegroups.com
Hiya Justin,

Not an option, as soon as the content is returned via ajax it is displayed- so there is no room for regex of any kind (it would be in javascript at this point not php) . However I am  simply echo-ing the content without json encoding it, which is fine for now.

Regards
Rob

elin

unread,
Jun 27, 2012, 6:19:53 PM6/27/12
to joomla-de...@googlegroups.com, in...@emc23.com
As far as I know lots of people have been using 5.4, admittedly with some notices, but not totally breaking in anyway.  We've been testing on 5.4 since at least last fall.

Do you have error reporting on maximum and if so what errors/warnings/notices are you getting?


Elin
To post to this group, send an email to joomla-dev-general@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To post to this group, send an email to joomla-dev-general@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-general+unsub...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.

rmcrn

unread,
Jun 28, 2012, 7:19:22 AM6/28/12
to joomla-de...@googlegroups.com, in...@emc23.com
perhaps you have an old php.ini from 5.3?

; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
Mostly this config value corrupts you code

http://php.net/manual/de/security.magicquotes.disabling.php

does it helps you?

Rob Stocker

unread,
Jun 28, 2012, 7:48:06 AM6/28/12
to joomla-de...@googlegroups.com
Hi rmcrn,

Interesting. I did indeed keep my old php.ini

I will test this and report back

thanks

Rob



--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/joomla-dev-general/-/_1ldmXNV2K8J.

To post to this group, send an email to joomla-de...@googlegroups.com.
To unsubscribe from this group, send email to joomla-dev-gene...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/joomla-dev-general?hl=en-GB.
Reply all
Reply to author
Forward
0 new messages