Support » Fixing WordPress » Ampersands break XHTML in comment link

  • I have finally (much later than planned) upgraded my website from WordPress 1.5.x to 2.0.x
    I tried initially to upgrade some time ago, but ran into a similar problem to the one I am having now – at that time, any ampersand symbols in a post title would stop the page validating as XHTML when it got to the title.
    Since then, this error seems to have been corrected, but then at a the end of the post a similar problem recurs – if there is an ampersand in the post title, then the title of the comment link “comment on …&.” will not validate because of the ampersand (although the one in the main title is now correctly created as &amp in the code.
    This would be a minor problem unless you have the content negotiation plugin turned on – if this is turned on then Firefox just rejects the page with an error mesage because of the ampersand.
    I’m assuming that I can fix this by altering something in /wp-includes/comment-functions.php
    I can find the code which creates the comment link at line 332, but having trid a few options, I’m not at all sure what it ought to be chaged to to fic the problem – or is there some other way that I ought to be approaching this problem? (& don’t tell me that I should escape all the ampersands when I type them – I’m looking for a simple solution which does not require thought every time I make a post).

    Any suggestions would be welcomed.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Ampersands break XHTML in comment link’ is closed to new replies.