No external Links in comments
No external Links in comments
URLs in Comments are not clickable for me... But the option is set to make them clickable...
-
MySchizoBuddy
- Regular
- Posts: 340
- Joined: Sun Jun 12, 2005 5:28 am
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
You would need to write a HTTP link code parser. My experience is that it only works in 60% of all cases and does more bad then good by transforming links that are no links.
BBCode is the common way to go.
Regards,
Garvin
BBCode is the common way to go.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
This should it do:
Should i package it in an textformatting plugin?function make_urls($messagetext)
{
var $urlSearchArray, $urlReplaceArray;
$urlSearchArray = array(
"/([^]_a-z0-9-=\"'\/])((https?|ftp|gopher|news|telnet):\/\/|www\.)([^ \r\n\(\)\^\$!`\"'\|\[\]\{\}<>]*)/si",
"/^((https?|ftp|gopher|news|telnet):\/\/|www\.)([^ \r\n\(\)\^\$!`\"'\|\[\]\{\}<>]*)/si"
$urlReplaceArray = array(
'\\1<a href="\\2\\4" target="_blank">\\2\\4</a>',
'<a href="\\1\\3" target="_blank">\\1\\3</a>'
);
$text = preg_replace($urlSearchArray, $urlReplaceArray, $messagetext);
return $text;
}
