Forums

Ampersands escaped in URLs within comments (5 posts)

  1. Anonymous
    Unregistered
    Posted 5 years ago #

    On my blog (http://sig.levillage.org/) equipped with Wordpress 0.72, when someone posts a comment containing an HTML link with an URL containing an ampersand, this URL gets mangled... Some characters (like the &) seem to be systematically escaped. IMO, this is a bug (not a feature). The escaping function should not escape ampersands in URL when the URL is a value of a tag attribute. What do you think ? Did I miss something ? Is there currently a workaroung ?
    -- Sig
    http://sig.levillage.org

  2. matt
    Troublemaker
    Posted 5 years ago #

    Ampersands in URLs SHOULD be encoded because if they aren't it violates the W3C specs. If it did something seriously funky it could be a bug though, if you could point te the comment in question we could help you better.

  3. antifuse
    Member
    Posted 5 years ago #

    Yeah, you want those ampersands escaped, otherwise it'll bugger up your RSS feeds (XML really doesn't like unescaped ampersands)

  4. Anonymous
    Unregistered
    Posted 5 years ago #

    OK. I apologize for my post above. Wordpress properly handles ampersands in URL. But ... it mistakenly suppress the string "ID=" when it appears in some URLs (in comments). I have set an example here : http://sig.levillage.org/index.php?p=386&c=1
    As you will see, I wanted to make a link toward http://www.dmreview.com/master.cfm?NavID=193&EdID=7438
    But the URL appeared as http://www.dmreview.com/master.cfm?Nav193&Ed7438 instead.
    -- Sig
    http://sig.levillage.org/

  5. TechGnome
    Moderator
    Posted 5 years ago #

    Trust me.... if you want that (X)HTML W3C validation... ampersands need to be escaped out. I had bee struggling with that problem for some time. When the browsert gets it, it will return the escaped doe back to it's proper character.
    TG

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.