From ed360d045a070569cd7bf3f9518c107b1e851cdb Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 29 Jul 2011 12:54:30 +0200 Subject: Fix escaping of html entities in tag names. Example case was a tag with & in its name, which resulted in a malformed rss feed. --- IkiWiki/Plugin/tag.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'IkiWiki/Plugin/tag.pm') diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm index ca74fef90..096c92616 100644 --- a/IkiWiki/Plugin/tag.pm +++ b/IkiWiki/Plugin/tag.pm @@ -199,8 +199,10 @@ sub pagetemplate (@) { if ($template->query(name => "categories")) { # It's an rss/atom template. Add any categories. if (defined $tags && %$tags) { - $template->param(categories => [map { category => tagname($_) }, - sort keys %$tags]); + eval q{use HTML::Entities}; + $template->param(categories => + [map { category => HTML::Entities::encode_entities(tagname($_)) }, + sort keys %$tags]); } } } -- cgit v1.2.3