How to manage ampersand (&) character

emmexx 06 Nov, 2013
I created a form to manage data imported from another system.
In that system html "special" characters like the & in Bed & Breakfast were saved in the db as &.

Now in my joomla/CF v4 system I have to show and to edit those data.
When I show them there's no problem, echo $form->data['myfield'] will output
Bed & Breakfast and that's ok in html.

But when I use CF to load a form with the content of that table, to edit it, I get an unexpected result:

<input id="nome" maxlength="150" size="30" class=" validate['required']" title="" type="text"  name="nome" value="Bed &amp; Breakfast" />

As you can see, the ampersand gets escaped.

Is it possible to tell CF not to do that?

Thank you
maxx
GreyHead 07 Nov, 2013
Hi emmexx,

I'm not sure where the escaping is taking place :-( It might be possible to use PHP in a Custom Code action to pre-process the data to remove any existing HTML entities before the re-publishing is done?

Bob
emmexx 07 Nov, 2013
Yes, lots of work... 😟

Or change the data in the database.

Thank you
maxx
This topic is locked and no more replies can be posted.