#78 Get Topic via XML with special characters

closed-fixed
nobody
None
5
2008-08-03
2008-08-01
rob_webset
No

Discovered a small bug with some of the stuff I submitted to return topic information as XML. If the title or description contains special characters then it will generate invalid XML. The solution for this is pretty simple, certain fields just need to be wrapped in:

<![CDATA[

....

]]>

I have attached an updated template with the changes in.

Thanks

Rob

Discussion

  • rob_webset

    rob_webset - 2008-08-01

    Updated XML Template

     
    Attachments
  • David Sitsky

    David Sitsky - 2008-08-03

    Logged In: YES
    user_id=208928
    Originator: NO

    Hi Rob,

    Wrapping it in a CDATA section is a bit of overkill and makes the XML a little bit more messy... how about we just pipe the data through html_entity like we do on our other templates for escaping data? This should work fine for XML data as well. For example:

    <title>[% topic.title | html_entity %]></title>

    If that works for you - can you send me an update? Thanks.

     
  • David Sitsky

    David Sitsky - 2008-08-03

    Logged In: YES
    user_id=208928
    Originator: NO

    I've just committed in the fix in any case using html_entity. Please let me know if it works for you - thanks.

     
  • David Sitsky

    David Sitsky - 2008-08-03
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks