Commit 646fdea1 authored by Sean Murphy's avatar Sean Murphy

Fixed 1174: schemeless URL auto-linking bug

parent d8ed0136
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment