From: Joey Hess Date: Fri, 29 Jul 2011 10:37:43 +0000 (+0200) Subject: Fix escaping of html entities in permalinks. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=65a7bc4e06efdbc5eac4b5b8fe76eb0344fcab3f;p=ikiwiki.git Fix escaping of html entities in permalinks. --- diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm index e9736584c..220fff9dc 100644 --- a/IkiWiki/Plugin/meta.pm +++ b/IkiWiki/Plugin/meta.pm @@ -312,14 +312,16 @@ sub pagetemplate (@) { $template->param(title_overridden => 1); } - foreach my $field (qw{author authorurl permalink}) { + foreach my $field (qw{author authorurl}) { $template->param($field => $pagestate{$page}{meta}{$field}) if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field); } foreach my $field (qw{permalink}) { - $template->param($field => IkiWiki::urlabs($pagestate{$page}{meta}{$field}, $config{url})) - if exists $pagestate{$page}{meta}{$field} && $template->query(name => $field); + if (exists $pagestate{$page}{meta}{$field} && $template->query(name => $field)) { + eval q{use HTML::Entities}; + $template->param($field => HTML::Entities::encode_entities(IkiWiki::urlabs($pagestate{$page}{meta}{$field}, $config{url}))); + } } foreach my $field (qw{description}) { diff --git a/debian/changelog b/debian/changelog index 0cb094a8d..20c5d20c7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ ikiwiki (3.20110716) UNRELEASED; urgency=low * po: Add `LANG_CODE` and `LANG_NAME` template variables. (intrigeri) * Fix typo in Danish translation of shortcuts page that caused expoentional regexp blowup. + * Fix escaping of html entities in permalinks. -- Joey Hess Tue, 19 Jul 2011 11:22:52 -0400