summaryrefslogtreecommitdiffstats
path: root/wp-includes/formatting.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-11 09:05:58 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-07-11 09:05:58 +0000
commitbe846080ae26c7358610f85a75034425a39b0dff (patch)
tree5accb8da9682bfbc61763c1220f0e8fa3a496a6e /wp-includes/formatting.php
parentcd78f6c49a3370eea1df8fb85d84ac7ac58fe1d5 (diff)
downloadwordpress-mu-be846080ae26c7358610f85a75034425a39b0dff.tar.gz
wordpress-mu-be846080ae26c7358610f85a75034425a39b0dff.tar.xz
wordpress-mu-be846080ae26c7358610f85a75034425a39b0dff.zip
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@645 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/formatting.php')
-rw-r--r--wp-includes/formatting.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index cc5e76b..7735d58 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -582,10 +582,11 @@ function antispambot($emailaddy, $mailto=0) {
}
function make_clickable($ret) {
- $ret = ' ' . $ret . ' ';
- $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3' rel='nofollow'>$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' rel='nofollow'>www.$2.$3$4</a>", $ret);
- $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([a-z0-9\-_.]+)\.([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3.$4\">$2@$3.$4</a>", $ret);
+ $ret = ' ' . $ret;
+ $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "$1<a href='$2' rel='nofollow'>$2</a>", $ret);
+ $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "$1<a href='http://$2' rel='nofollow'>$2</a>", $ret);
+ $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
+ $ret = substr($ret, 1);
$ret = trim($ret);
return $ret;
}