diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-09-17 07:22:34 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-09-17 07:22:34 -0400 |
commit | 00eb929c6ba314abf431d92117bd3cee5a73b2ff (patch) | |
tree | 91405a01a4d21fb9a085de1b674cbc06ff643fb5 /lib/util.php | |
parent | b20bd3b50879faf97f9ec3518153136dba172ef2 (diff) |
use common_local_url() in tagging, add canonicalization function
darcs-hash:20080917112234-84dde-69fb6c2dc279b8fffd5c524673808d8991e99429.gz
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/util.php b/lib/util.php index 0b71cfe4f..51dcbe939 100644 --- a/lib/util.php +++ b/lib/util.php @@ -699,11 +699,13 @@ function common_render_content($text, $notice) { } function common_tag_link($tag) { - if(common_config('site', 'fancy')) { - return '<a href="' . htmlspecialchars(common_path('tag/' . strtolower(str_replace(array('-', '_', '.'), '', $tag)))) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; - } else { - return '<a href="' . htmlspecialchars(common_path('index.php?action=tag&tag=' . strtolower(str_replace(array('-', '_', '.'), '', $tag)))) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; - } + $canonical = common_canonical_tag($tag); + $url = common_local_url('tag', array('tag' => $canonical)); + return '<a href="' . htmlspecialchars($url) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; +} + +function common_canonical_tag($tag) { + return strtolower(str_replace(array('-', '_', '.'), '', $tag)); } function common_at_link($sender_id, $nickname) { |