X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/9a99c4c6e2228954b27e1e93e2b66c12a74850ac..11d5b5c5ea6193e6c6f219b021883a6424b23d38:/IkiWiki/Plugin/aggregate.pm diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index 28c445913..05e22a290 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -553,7 +553,9 @@ sub aggregate (@) { }; } if ($@) { - $feed->{message}=gettext("feed crashed XML::Feed!")." ($@)"; + # gettext can clobber $@ + my $error = $@; + $feed->{message}=gettext("feed crashed XML::Feed!")." ($error)"; $feed->{error}=1; debug($feed->{message}); next; @@ -569,7 +571,9 @@ sub aggregate (@) { # XML::Feed doesn't work around XML::Atom's bizarre # API, so we will. Real unicode strings? Yes please. # See [[bugs/Aggregated_Atom_feeds_are_double-encoded]] + no warnings 'once'; local $XML::Atom::ForceUnicode = 1; + use warnings; my $c=$entry->content; # atom feeds may have no content, only a summary @@ -617,11 +621,11 @@ sub add_page (@) { # escape slashes and periods in title so it doesn't specify # directory name or trigger ".." disallowing code. $page=~s!([/.])!"__".ord($1)."__"!eg; - $page=$feed->{dir}."/".$page; - ($page)=$page=~/$config{wiki_file_regexp}/; if (! defined $page || ! length $page) { $page=$feed->{dir}."/item"; } + $page=$feed->{dir}."/".$page; + ($page)=$page=~/$config{wiki_file_regexp}/; my $c=""; while (exists $IkiWiki::pagecase{lc $page.$c} || -e $IkiWiki::Plugin::transient::transientdir."/".htmlfn($page.$c) || @@ -675,7 +679,9 @@ sub write_page ($$$$$) { $template=template($feed->{template}, blind_cache => 1); }; if ($@) { - print STDERR gettext("failed to process template:")." $@"; + # gettext can clobber $@ + my $error = $@; + print STDERR gettext("failed to process template:")." $error"; return; } $template->param(title => $params{title})