escape html for related tags form

This commit is contained in:
Toks
2013-05-05 20:31:07 -04:00
parent 357332a506
commit c1371eb0a2
2 changed files with 4 additions and 4 deletions

View File

@@ -57,7 +57,7 @@
var link = $("<a/>"); var link = $("<a/>");
var count = $("<span/>"); var count = $("<span/>");
link.html(entry.tags); link.text(entry.tags);
link.click(Danbooru.Blacklist.toggle_entry); link.click(Danbooru.Blacklist.toggle_entry);
count.html(entry.hits); count.html(entry.hits);
item.append(link); item.append(link);

View File

@@ -164,7 +164,7 @@
var $ul = $("<ul/>"); var $ul = $("<ul/>");
$ul.append( $ul.append(
$("<li/>").append( $("<li/>").append(
$("<em/>").html( $("<em/>").text(
query.replace(/_/g, " ") query.replace(/_/g, " ")
) )
) )
@@ -173,7 +173,7 @@
$.each(related_tags, function(i, tag) { $.each(related_tags, function(i, tag) {
if (tag[0][0] !== " ") { if (tag[0][0] !== " ") {
var $link = $("<a/>"); var $link = $("<a/>");
$link.html(tag[0].replace(/_/g, " ")); $link.text(tag[0].replace(/_/g, " "));
$link.addClass("tag-type-" + tag[1]); $link.addClass("tag-type-" + tag[1]);
$link.attr("href", "/posts?tags=" + encodeURIComponent(tag[0])); $link.attr("href", "/posts?tags=" + encodeURIComponent(tag[0]));
$link.click(Danbooru.RelatedTag.toggle_tag); $link.click(Danbooru.RelatedTag.toggle_tag);
@@ -184,7 +184,7 @@
$("<li/>").append($link) $("<li/>").append($link)
); );
} else { } else {
$ul.append($("<li/>").html(tag[0])); $ul.append($("<li/>").text(tag[0]));
} }
}); });