Fix double-escaping pointed out by Shish <3

This commit is contained in:
Daniel Oaks 2020-03-23 21:22:30 +10:00
parent 9484c9173c
commit a83c460b70
2 changed files with 4 additions and 4 deletions

View File

@ -127,12 +127,12 @@ class TagCategories extends Extension
return $tc_keyed_dict; return $tc_keyed_dict;
} }
public function getTagHtml(string $tag, $tag_category_dict, string $extra_text = '') public function getTagHtml(string $h_tag, $tag_category_dict, string $extra_text = '')
{ {
$h_tag_no_underscores = str_replace("_", " ", $tag); $h_tag_no_underscores = str_replace("_", " ", $h_tag);
// we found a tag, see if it's valid! // we found a tag, see if it's valid!
$h_tag_split = explode(':', $tag, 2); $h_tag_split = explode(':', $h_tag, 2);
if ((count($h_tag_split) > 1) and array_key_exists($h_tag_split[0], $tag_category_dict)) { if ((count($h_tag_split) > 1) and array_key_exists($h_tag_split[0], $tag_category_dict)) {
$category = $h_tag_split[0]; $category = $h_tag_split[0];
$h_tag = $h_tag_split[1]; $h_tag = $h_tag_split[1];

View File

@ -301,7 +301,7 @@ class TagList extends Extension
} }
$h_tag_no_underscores = str_replace("_", " ", $h_tag); $h_tag_no_underscores = str_replace("_", " ", $h_tag);
if (class_exists('TagCategories')) { if (class_exists('TagCategories')) {
$h_tag_no_underscores = $this->tagcategories->getTagHtml(html_escape($h_tag), $tag_category_dict); $h_tag_no_underscores = $this->tagcategories->getTagHtml($h_tag, $tag_category_dict);
} }
$html .= "&nbsp;<a style='font-size: ${size}em' href='$link'>$h_tag_no_underscores</a>&nbsp;\n"; $html .= "&nbsp;<a style='font-size: ${size}em' href='$link'>$h_tag_no_underscores</a>&nbsp;\n";
} }