use common_local_url() in tagging, add canonicalization function

darcs-hash:20080917112234-84dde-69fb6c2dc279b8fffd5c524673808d8991e99429.gz
This commit is contained in:
Evan Prodromou 2008-09-17 07:22:34 -04:00
parent b20bd3b508
commit 00eb929c6b

View File

@ -699,11 +699,13 @@ function common_render_content($text, $notice) {
} }
function common_tag_link($tag) { function common_tag_link($tag) {
if(common_config('site', 'fancy')) { $canonical = common_canonical_tag($tag);
return '<a href="' . htmlspecialchars(common_path('tag/' . strtolower(str_replace(array('-', '_', '.'), '', $tag)))) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>'; $url = common_local_url('tag', array('tag' => $canonical));
} else { return '<a href="' . htmlspecialchars($url) . '" rel="tag" class="hashlink">' . htmlspecialchars($tag) . '</a>';
return '<a href="' . htmlspecialchars(common_path('index.php?action=tag&tag=' . strtolower(str_replace(array('-', '_', '.'), '', $tag)))) . '" 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) { function common_at_link($sender_id, $nickname) {