Support » Fixing WordPress » External Protocols in Blogroll/Links Manager?

  • Resolved macbis


    External protocol links do not seem to work when added to the Blogroll. I’m attempting to link to a Ventrilo server using:


    But WP prepends this with “http://”, resulting in a broken link. Is there a workaround for this?

    A friend of mine pointed me to wp-includes/kses.php but the functions do not seem to be related to links in the blogroll.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Yeah, I wish they’d get rid of that…

    If you look in admin-functions.php, in the edit_link() function, around about line 600, you’ll find this line:
    $_POST['link_url'] = clean_url($_POST['link_url']);

    Comment that line out or remove it entirely. That should fix it to allow you to put whatever you please in there.

    Bwah, apparently they changed some of the functions relating to all of this between 2.1.2 and 2.1.3, which caused me a bit of confusion when looking at different versions of source code.

    The clean_url function looks like it has some semi-important stuff in it, so I was hesitant to comment the whole line out, so I took a closer look and narrowed it down to the following change:

    wp-includes/formatting.php @ Line 1082

    $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet');
    $protocols = array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'ventrilo');

    Thanks for your reply; it definitely pointed me in the right direction. It’s a shame this turned out to be a core file edit. That always leave a dirty taste in my mouth.

    That will work as well, but commenting out the line I pointed you to (specifically, the clean_url line) will eliminate this entirely, allowing you to use any protocol you like. I find this to be a much more suitable fix than simply adding protocols to that list.

    clean_url() does more or less what it says, it takes the URL you put in and attempts to clean it up. I dislike WordPress trying to second guess me there, and simply disabling that line prevents it from mucking with my URL at all (short of special character cleanup).

    My problem is that I write in an external link I want in a post in code but as soon as I switch to “visual” or “view site” WP has changed the link to point back to my own blog.

    Is this the same problem as you explained about the edit_link()function?

    If so, where do I find admin-functions.php so I can comment out that line 600?
    By comment out, do you mean adding: <!– to start it and –> to end it?

    Sorry to be a deunce! I sure appreciate your help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘External Protocols in Blogroll/Links Manager?’ is closed to new replies.