Commit f577cb3b authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Encode tag name in element id


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent a3624d4e
......@@ -2084,6 +2084,11 @@ function get_my_tags($limit=null, $cloud=true, $sort='freq') {
}
usort($tagrecords, create_function('$a,$b', 'return strnatcasecmp($a->tag, $b->tag);'));
}
else {
foreach ($tagrecords as &$t) {
$t->tagurl = urlencode($t->tag);
}
}
return $tagrecords;
}
......
......@@ -126,7 +126,7 @@ function rewriteTagLink(elem, keep, replace) {
// Mark the selected tag in the My Tags list:
if (data.data.tag) {
addElementClass('tag:' + data.data.tag, 'selected');
addElementClass('tag:' + data.data.tagurl, 'selected');
}
// Replace the tag in the Search Results heading
......@@ -191,7 +191,7 @@ function rewriteTagLink(elem, keep, replace) {
addLoadEvent(function() {
forEach(inittags, function(t) {
mytags['tag:' + t.tag] = t.count;
mytags['tag:' + t.tagurl] = t.count;
});
forEach(getElementsByTagAndClassName('a', 'tag-sort'), rewriteTagSortLink);
......
......@@ -9,7 +9,7 @@
</ul>
<div class="subpage mytags">
{foreach from=$tags item=t}
<a id="tag:{$t->tag}" class="tag{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}tags.php?tag={$t->tag|urlencode}">{$t->tag|str_shorten_text:30|escape}&nbsp;<span class="tagfreq">({$t->count})</span></a>
<a id="tag:{$t->tag|urlencode}" class="tag{if $t->tag == $tag} selected{/if}" href="{$WWWROOT}tags.php?tag={$t->tag|urlencode}">{$t->tag|str_shorten_text:30|escape}&nbsp;<span class="tagfreq">({$t->count})</span></a>
{/foreach}
</div>
{else}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment