Make work with https URIs

git-svn-id: http://svn.automattic.com/wordpress/trunk@2008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-12-28 20:28:57 +00:00
parent 90d0421792
commit 8c472b4241

View File

@ -495,9 +495,9 @@ function antispambot($emailaddy, $mailto=0) {
return $emailNOSPAMaddy;
}
function make_clickable($ret) { // original function: phpBB
function make_clickable($ret) {
$ret = ' ' . $ret . ' ';
$ret = preg_replace("#(\s)http://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='http://$2'>http://$2</a>", $ret);
$ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3'>$2://$3</a>", $ret);
$ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4'>www.$2.$3$4</a>", $ret);
$ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
$ret = trim($ret);