X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ecf2399f4fd2a515f4f5d6f0040024097a284343..e307eeda3d55446f4bdeb2ac48f4fef0c24b1f3d:/IkiWiki/Plugin/aggregate.pm diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index c9c2880c5..6cdbbc0e9 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -496,15 +496,19 @@ sub aggregate (@) { #{{{ # that contains invalid UTF-8 sequences. Convert # feed to ascii to try to work around. $feed->{message}.=" ".sprintf(gettext("(invalid UTF-8 stripped from feed)")); - $content=Encode::decode_utf8($content, 0); - $f=eval{XML::Feed->parse(\$content)}; + $f=eval { + $content=Encode::decode_utf8($content, 0); + XML::Feed->parse(\$content) + }; } if ($@) { # Another possibility is badly escaped entities. $feed->{message}.=" ".sprintf(gettext("(feed entities escaped)")); $content=~s/\&(?!amp)(\w+);/&$1;/g; - $content=Encode::decode_utf8($content, 0); - $f=eval{XML::Feed->parse(\$content)}; + $f=eval { + $content=Encode::decode_utf8($content, 0); + XML::Feed->parse(\$content) + }; } if ($@) { $feed->{message}=gettext("feed crashed XML::Feed!")." ($@)"; @@ -606,7 +610,7 @@ sub add_page (@) { #{{{ my $template=template($feed->{template}, blind_cache => 1); $template->param(title => $params{title}) if defined $params{title} && length($params{title}); - $template->param(content => htmlescape(htmlabs($params{content}, + $template->param(content => wikiescape(htmlabs($params{content}, defined $params{base} ? $params{base} : $feed->{feedurl}))); $template->param(name => $feed->{name}); $template->param(url => $feed->{url}); @@ -633,11 +637,9 @@ sub add_page (@) { #{{{ } } #}}} -sub htmlescape ($) { #{{{ +sub wikiescape ($) { #{{{ # escape accidental wikilinks and preprocessor stuff - my $html=shift; - $html=~s/(?