Welcome Guest, Not a member yet? Register   Sign In
auto_link with 2 urls from the same domain
#31

[eluser]Unknown[/eluser]
i had this problem too, so i modified auto_link().
not well testing, but it works for me so far.

here is the code:

Code:
function auto_link() {
        if ($type != 'email')
    {
      // only accept url start with httP(s):// or www.
          $str = preg_replace("#(https?://|www.)+[a-z0-9-]+[\.a-z]+[\/a-z0-9_\#\@\?\&\=\.\-]*#i", ("$1" != 'www.') ? "<a href='$0'>$0</a>" : "<a href='http://$0'>$0</a>", $str);
    }

}




Theme © iAndrew 2016 - Forum software by © MyBB