Skip to content

Problem with the links on comments.

Sadly, I had a minor problem with the links from the comments to the targets of those links… WordPress somehow URL-encoded the ' rel='external nofollow'-part into the URL, resulting in something like <a href=''rel='external nofollow'>link text</a> which – needless to say – did not really work that well. Turns out the culprit was in comment-template.php on line 148 (Vanilla wordpress 2.7), which reads $return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";. I simply replaced the ‘ with \", and suddenly everything works. Damn strange I’m the only one with this problem tho.
The full line, changed, reads the following:

$return = "<a href=\"$url\" rel=\"external nofollow\" class=\"url\">$author</a>";

{ 1 } Comments

  1. | 20090410 at 11:44 | Permalink

    I guess it’s because single quotes are not XML, so is allowed in HTML but not in XHTML