Fixed 1174: schemeless URL auto-linking bug
This commit is contained in:
parent
d8ed013612
commit
646fdea1bf
@ -418,8 +418,8 @@ function common_replace_urls_callback($text, $callback) {
|
|||||||
// Make sure we didn't pick up an email address
|
// 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;
|
if (preg_match('#^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$#i', $url)) continue;
|
||||||
|
|
||||||
// Remove trailing punctuation
|
// Remove surrounding punctuation
|
||||||
$url = rtrim($url, '.?!,;:\'"`');
|
$url = trim($url, '.?!,;:\'"`([<');
|
||||||
|
|
||||||
// Remove surrounding parens and the like
|
// Remove surrounding parens and the like
|
||||||
preg_match('/[)\]>]+$/', $url, $trailing);
|
preg_match('/[)\]>]+$/', $url, $trailing);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user