mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Improved autolink function. http://mosquito.wordpress.org/bug_view_page.php?bug_id=0000236
git-svn-id: http://svn.automattic.com/wordpress/trunk@1571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d39d7e2347
commit
17433d3a32
@ -326,15 +326,13 @@ function antispambot($emailaddy, $mailto=0) {
|
||||
return $emailNOSPAMaddy;
|
||||
}
|
||||
|
||||
function make_clickable($text) { // original function: phpBB, extended here for AIM & ICQ
|
||||
$ret = " " . $text;
|
||||
$ret = preg_replace("#([\n ])([a-z]+?)://([^, <>{}\n\r]+)#i", "\\1<a href=\"\\2://\\3\" target=\"_blank\">\\2://\\3</a>", $ret);
|
||||
$ret = preg_replace("#([\n ])aim:([^,< \n\r]+)#i", "\\1<a href=\"aim:goim?screenname=\\2\\3&message=Hello\">\\2\\3</a>", $ret);
|
||||
$ret = preg_replace("#([\n ])icq:([^,< \n\r]+)#i", "\\1<a href=\"http://wwp.icq.com/scripts/search.dll?to=\\2\\3\">\\2\\3</a>", $ret);
|
||||
$ret = preg_replace("#([\n ])www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^,< \n\r]*)?)#i", "\\1<a href=\"http://www.\\2.\\3\\4\" target=\"_blank\">www.\\2.\\3\\4</a>", $ret);
|
||||
$ret = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([^,< \n\r]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
|
||||
$ret = substr($ret, 1);
|
||||
return $ret;
|
||||
function make_clickable($ret) { // original function: phpBB
|
||||
$ret = ' ' . $ret . ' ';
|
||||
$ret = preg_replace("#(\s)http://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='http://$2'>http://$2</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);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function convert_smilies($text) {
|
||||
|
Loading…
Reference in New Issue
Block a user