diff options
-rw-r--r-- | classes/Notice.php | 2 | ||||
-rw-r--r-- | lib/util.php | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 8c2097589..5e1f83a52 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -54,7 +54,7 @@ class Notice extends DB_DataObject function saveTags() { /* extract all #hastags */ - $count = preg_match_all('/(?:^|\s)#([a-z0-9]{1,64})/', strtolower($this->content), $match); + $count = preg_match_all('/(?:^|\s)#([A-Za-z0-9]{1,64})/', strtolower($this->content), $match); if (!$count) { return true; } diff --git a/lib/util.php b/lib/util.php index 93a0711f3..469bc986f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -688,16 +688,16 @@ function common_render_content($text, $notice) { $r = preg_replace('@https?://[^)\]>\s]+@', '<a href="\0" class="extlink">\0</a>', $r); $r = preg_replace('/(^|\s+)@([a-z0-9]{1,64})/e', "'\\1@'.common_at_link($id, '\\2')", $r); $r = preg_replace('/^T ([A-Z0-9]{1,64}) /e', "'T '.common_at_link($id, '\\1').' '", $r); - $r = preg_replace('/(^|\s+)#([a-z0-9]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); + $r = preg_replace('/(^|\s+)#([A-Za-z0-9]{1,64})/e', "'\\1#'.common_tag_link('\\2')", $r); # XXX: machine tags return $r; } function common_tag_link($tag) { if(common_config('site', 'fancy')) { - return '<a href="' . htmlspecialchars(common_path('tag/' . $tag)) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; + return '<a href="' . htmlspecialchars(common_path('tag/' . strtolower($tag))) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; } else { - return '<a href="' . htmlspecialchars(common_path('index.php?action=tag&tag=' . $tag)) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; + return '<a href="' . htmlspecialchars(common_path('index.php?action=tag&tag=' . strtolower($tag))) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; } } |