From 646fdea1bf8a93bbfb60212982a218994ffa8bbe Mon Sep 17 00:00:00 2001 From: Sean Murphy Date: Tue, 10 Feb 2009 17:42:58 -0500 Subject: Fixed 1174: schemeless URL auto-linking bug --- lib/util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/util.php') diff --git a/lib/util.php b/lib/util.php index 75d1e21a4..a130c7d49 100644 --- a/lib/util.php +++ b/lib/util.php @@ -418,8 +418,8 @@ function common_replace_urls_callback($text, $callback) { // Make sure we didn't pick up an email address if (preg_match('#^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$#i', $url)) continue; - // Remove trailing punctuation - $url = rtrim($url, '.?!,;:\'"`'); + // Remove surrounding punctuation + $url = trim($url, '.?!,;:\'"`([<'); // Remove surrounding parens and the like preg_match('/[)\]>]+$/', $url, $trailing); -- cgit v1.2.3-54-g00ecf