Switched from CData to HTMLSpecialChars in Description - Now Not Showing


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.


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.

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).


Example here: http://feed.traileraddict.com/dom-hemingway (you can now see the descriptions with HTML characters decoded, though still displaying).