Updated for V3 credit to Original Author
Fix the redirect problem the with links
functions.php find
Replace with
Find
Replace with
Fix the redirect problem the with links
functions.php find
// Text
$s = preg_replace(
"/\[url=((http|ftp|https|ftps|irc):\/\/[^<>\s]+?)\]((\s|.)+?)\[\/url\]/i",
"<a href='http://kpaste.net/redir/\\1' target='_blank'>\\3</a>", $s);
// http://www.example.com
$s = preg_replace(
"/\[url\]((http|ftp|https|ftps|irc):\/\/[^<>\s]+?)\[\/url\]/i",
"<a href='http://kpaste.net/redir/\\1' target='_blank'>\\1</a>", $s);Replace with
// Text
$s = preg_replace(
"/\[url=((http|ftp|https|ftps|irc):\/\/[^<>\s]+?)\]((\s|.)+?)\[\/url\]/i",
"<a href='\\1' target='_blank'>\\3</a>", $s);
// http://www.example.com
$s = preg_replace(
"/\[url\]((http|ftp|https|ftps|irc):\/\/[^<>\s]+?)\[\/url\]/i",
"<a href='\\1' target='_blank'>\\1</a>", $s);Find
function format_urls($s){
return preg_replace(
"/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^<>\s]+)/i",
"\\1<a href='http://kpaste.net/redir/\\2' target='_blank'>\\2</a>", $s);
}Replace with
function format_urls($s){
return preg_replace(
"/(\A|[^=\]'\"a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^<>\s]+)/i",
"\\1<a href='\\2' target='_blank'>\\2</a>", $s);
}

