X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/204dcda88bc595d1ad301a08ae25ebe4bd2afb8a..c7bdebaaf134729356852918b387071c92f85e72:/IkiWiki/Plugin/aggregate.pm?ds=sidebyside

diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm
index 28c445913..be7da3a71 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
@@ -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})