Fixes #1258: A period in a hashtag leads to the tag being interpreted as url and hence breaking the tag.

This commit is contained in:
Adrian Lang 2009-02-22 17:45:26 +01:00 committed by Evan Prodromou
parent 32e0fb1483
commit 120eb77400
1 changed files with 3 additions and 0 deletions

View File

@ -456,6 +456,9 @@ function common_replace_urls_callback($text, $callback) {
if (!in_array($url_parts[2], $tlds)) continue;
// Make sure we didn't capture a hash tag
if (strpos($url, '#') === 0) continue;
// Put the url back the way we found it.
$url = (mb_strpos($orig_url, htmlspecialchars($url)) === FALSE) ? $url:htmlspecialchars($url);