WordPress.org

Ready to get started?Download WordPress

Forums

Link problem (4 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    Hello..
    I have recently installed wordpress and I'm so far pleased. One friend of mine added a comment with following link http://www.jp.dk/itogc/artikel:aid=2144560/ but the link appears in this way.. http://www.jp.dk/itogc/artikel:a2144560/ i don't know what's wrong, the link is correct i my mySQL database.. but the error comes when parsing.
    my blog is at URL: http://www.milpoer.dk/blog

  2. Laughinglizard
    Member
    Posted 10 years ago #

    I recently ran into this issue as well. The problem is that the comments go through a sanitising feature which takes out malicious content but also filters out some useful parts of URLs in comments. Here is the fix, though I suggest you leave it the way it is for security:
    Find this function inside b2template.functions.php which is inside the b2-include folder:
    function comment_text() {
    global $comment;
    $comment_text = stripslashes($comment->comment_content);
    $comment_text = str_replace('<trackback />', '', $comment_text);
    $comment_text = str_replace('<pingback />', '', $comment_text);
    $comment_text = convert_chars($comment_text);
    $comment_text = convert_bbcode($comment_text);
    $comment_text = convert_gmcode($comment_text);
    $comment_text = convert_smilies($comment_text);
    $comment_text = make_clickable($comment_text);
    $comment_text = balanceTags($comment_text,1);
    $comment_text = apply_filters('comment_text', $comment_text);
    echo $comment_text;
    }
    Change it to:
    function comment_text() {
    global $comment;
    $comment_text = stripslashes($comment->comment_content);
    $comment_text = str_replace('<trackback />', '', $comment_text);
    $comment_text = str_replace('<pingback />', '', $comment_text);
    $comment_text = convert_chars($comment_text);
    $comment_text = convert_bbcode($comment_text);
    $comment_text = convert_gmcode($comment_text);
    $comment_text = convert_smilies($comment_text);
    $comment_text = make_clickable($comment_text);
    //Made change to comments to make some links work
    $comment_text = balanceTags($comment_text,0);
    $comment_text = apply_filters('comment_text', $comment_text);
    echo $comment_text;
    }

  3. Anonymous
    Unregistered
    Posted 10 years ago #

    Thank you..
    I works fine in my comment no. 3 http://www.milpoer.dk/blog/index.php?p=17&c=1#comments but not with comment 4. the link is the same. but i don't see why there is a different between these two.

  4. Anonymous
    Unregistered
    Posted 10 years ago #

    Now it works both places, Thank you..

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.