summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorAdrian Lang <mail@adrianlang.de>2009-02-22 17:45:26 +0100
committerEvan Prodromou <evan@controlyourself.ca>2009-02-27 15:44:06 -0800
commit120eb77400843669980850882dfae83ca7f8e7e7 (patch)
treea6081a3ce2f08d15982887aafa7baa0dc626cb6f /lib/util.php
parent32e0fb148312bb2a052111513ed71fc4948a9fb7 (diff)
Fixes #1258: A period in a hashtag leads to the tag being interpreted as url and hence breaking the tag.
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php
index 5345a08bb..18e4f310c 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -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);