casbboy — 2014-01-04T04:02:17-05:00 — #1
I've been using the CDATA tag in my description container for RSS forever and have decided to get rid of the CDATA container and instead have php just convert all the HTML entities with htmlentities (or htmlspecialchars).
However, I've done that and now I can't see the properly formatted feed in Firefox.
The description doesn't even show up at all. What am I doing wrong? I see that Vimeo does same thing, but successfully, so can't figure out what they are doing different.
All feedback appreciated.
felgall — 2014-01-04T15:40:20-05:00 — #2
CDATA and htmlentities (or htmlspecialchars) are used for totally different purposes and one cannot be substituted for the other. It would be like substituting a cheese sandwich for your car and expecting to be able to drive that to work.
casbboy — 2014-01-04T16:05:07-05:00 — #3
Actually, I reviewed my output closely and realized I had "<br /><br />" hand written into the Description container which was causing it to fail since illegal characters without CDATA. I added
$doublebreak = '<br /><br />';
$doublebreak = htmlentities($doublebreak);
And then put the $doublebreak variable inside the description container to replace <br /><br /> and it fixed everything and is validating and showing properly in the browser once again (just like the Vimeo comparison).
casbboy — 2014-01-04T16:05:44-05:00 — #4
Example here: http://feed.traileraddict.com/dom-hemingway (you can now see the descriptions with HTML characters decoded, though still displaying).