ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Unencoded ampersands

December 27, 2010 11:25am

Subscribe [3]
  • #1 / Dec 27, 2010 11:25am

    Lee Powell

    88 posts

    Hi,

    I’ve noticed today that when using ampersands in category names, and post titles, that when outputting them through the templating language they fail validation due to being unencoded as “&”

    I’m fairly new to EE, so there’s probably something I’ve forgotten to do - but any advice on how to output them encoded properly would be helpful.

    Thanks.

  • #2 / Dec 27, 2010 5:02pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Where do these ampersands occur, exactly? If it’s a custom field, what formatting are you using?

  • #3 / Dec 27, 2010 5:53pm

    Lee Powell

    88 posts

    The latest version of EE 2.1.3 - it appears that Category Names are not being encoded when outputting. I’ve fixed the Post Titles one, as that was my mistake and coming out of a 3rd Party Plugin.

    But Category Names are definitely not being encoded.

    Thanks.

  • #4 / Dec 28, 2010 3:42am

    John Henry Donovan

    12339 posts

    Lee,

    I don’t believe category names were ever encoded. I just usually wrap them in the included xml:encode plugin.

    {exp:channel:categories channel="news"}
    <a href="http://{path=channel/index}">{exp:xml_encode}{category_name}{/exp:xml_encode}</a>
    {/exp:channel:categories}
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases