Menu

#15 Wrap Title and Description output with <![CDATA[ ]]>

open
nobody
None
5
2007-03-12
2007-03-12
Jess C.
No

I was having some trouble getting a feed to validate due to an interesting combination of HTML entities. There wasn't an 'easy' way to filter them, so I tried modifying feedcreator.class.php to wrap the <title /> and <description /> output in the RSSCreator091 class with <![CDATA[ ]]>, and the XML was then able to validate.

So for example:

$feed.= "<description><![CDATA[".$this->items[$i]->getDescription()." ]]></description>\n";

I'd like to request this be part of the class for Title and Description.

Discussion

  • Jess C.

    Jess C. - 2007-03-12

    Logged In: YES
    user_id=446495
    Originator: YES

    I just realized this is more complicated than it originally seemed. After using <![CDATA[ ]]>, any HTML in the Title or Description is completely escaped, so the HTML tags show up in the text, rather than rendering out. This may take more thought.

     
  • Nobody/Anonymous

    Logged In: NO

    Check descriptionHtmlSyndicated... Is not that what you want? :)

     

Log in to post a comment.

MongoDB Logo MongoDB