1 (edited by rADo 2004-06-25 09:33)

Topic: https:// bug

parser.php completely messes-up https://url links.. ( https://sourceforge.net/project/showfil … _id=121144 )

2

Re: https:// bug

here's the fix:

function truncate_url($url, $link = '')
{
    global $cur_user;
    $full_url = $url;
    if ( (strpos($url, 'www.')!==false) && 
       (strpos($url, 'http://')===false) && 
       (strpos($url, 'https://')===false) && 
       (strpos($url, 'ftp://')===false)
  )
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') !== false)
        $full_url = 'ftp://'.$full_url;

    // Ok, not very pretty :-)
    $link = ($link == '' || $link == $url) ? 
    ((strlen($url) > 55) ? substr($url, 0 , 39).' ... '.substr($url, -10) : $url) 
    : 
    stripslashes($link);

    // if ($cur_user['link_to_new_win'] == '0')
    return '<a href="'.$full_url.'">'.$link.'</a>';
}

Re: https:// bug

It was fixed earlier together with the ftp:// bug.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

4

Re: https:// bug

well, ok, is there some CVS for PunBB? Moving over to sourceforge.net?

Re: https:// bug

Currently not. I'm halfway through an installation of Subversion (I hate CVS) together with a complete project management tool (Trac), but I just haven't had time to complete it. Soon.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: https:// bug

Rickard wrote:

Currently not. I'm halfway through an installation of Subversion (I hate CVS) together with a complete project management tool (Trac), but I just haven't had time to complete it. Soon.

I know subversion (no comment), but what's Trac, can you give an URL?


    Elrond

7

Re: https:// bug

Is this it?
http://www.edgewall.com/

Re: https:// bug

Yes, that's it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."