summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorGarret Buell <terragb@gmail.com>2008-08-31 20:12:41 -0400
committerGarret Buell <terragb@gmail.com>2008-08-31 20:12:41 -0400
commitcca78b26f71aaa5792e147b8a96c5e26a369bd82 (patch)
tree11a6bef00db0d21c54dff24c203111ad84ed9376 /lib/util.php
parente333345722f7a9241bc4e4ec2588eba5e075deff (diff)
Allow_multicase_tags
Make "#test", "#Test", and "#tEsT" all preserve appearance but link to the same tag darcs-hash:20080901001241-e3c0d-b466f35f4f023c6c90a6d2817487c97be9a1bbca.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php6
1 files changed, 3 insertions, 3 deletions
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>';
}
}