]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed 1174: schemeless URL auto-linking bug
authorSean Murphy <sgmurphy@gmail.com>
Tue, 10 Feb 2009 22:42:58 +0000 (17:42 -0500)
committerSean Murphy <sgmurphy@gmail.com>
Tue, 10 Feb 2009 22:42:58 +0000 (17:42 -0500)
lib/util.php

index 75d1e21a47a4254cd6da9d49f1b5691ace432f44..a130c7d49cc8d3d57a6e6a7b3ba6c26c68fb3564 100644 (file)
@@ -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);