From 7a8c7eb2e34db5da6844b3c2702eadb81bad1f6a Mon Sep 17 00:00:00 2001 From: Matt Mullenweg Date: Tue, 28 Dec 2004 20:28:57 +0000 Subject: [PATCH] Make work with https URIs git-svn-id: https://develop.svn.wordpress.org/trunk@2008 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/functions-formatting.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 1acf7a1799..5070c29a2e 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -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", "$1http://$2", $ret); + $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1$2://$3", $ret); $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1www.$2.$3$4", $ret); $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1$2@$3", $ret); $ret = trim($ret);