WordPress.org

Ready to get started?Download WordPress

Forums

Ampersands break XHTML in comment link (3 posts)

  1. mat8iou
    Member
    Posted 8 years ago #

    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.

  2. murky
    Member
    Posted 8 years ago #

  3. mat8iou
    Member
    Posted 7 years ago #

    Thank for this solution to the problem - I din't notice that I'd had any replies until just now.
    The thing that I find strange is that it used to work fine on 1.5.x - it was only with 2.x that the code caused these errors.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags