No external Links in comments
Posted: Tue Nov 22, 2005 11:08 am
URLs in Comments are not clickable for me... But the option is set to make them clickable...
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;
}