summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Murphy <sgmurphy@gmail.com>2009-02-10 17:42:58 -0500
committerSean Murphy <sgmurphy@gmail.com>2009-02-10 17:42:58 -0500
commit646fdea1bf8a93bbfb60212982a218994ffa8bbe (patch)
tree0a73874ad48de2b7c924f88fbfddc5b620b39fbb /lib
parentd8ed013612aa974753e25b933cf379fa76002c64 (diff)
Fixed 1174: schemeless URL auto-linking bug
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php4
1 files changed, 2 insertions, 2 deletions
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);