]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/edittemplate.pm
protect $@ whenever a block using $@ is non-trivial
[ikiwiki.git] / IkiWiki / Plugin / edittemplate.pm
index c7f1e4fa7f7117660b5d89207a1795caec9fc6af..e3ce5e3d97437392c681f20f6c3a23b0b9690790 100644 (file)
@@ -130,9 +130,11 @@ sub filltemplate ($$) {
                $template=template("/".$template_page);
        };
        if ($@) {
+               # gettext can clobber $@
+               my $error = $@;
                # Indicate that the earlier preprocessor directive set 
                # up a template that doesn't work.
-               return "[[!edittemplate ".gettext("failed to process template:")." $@]]";
+               return "[[!edittemplate ".gettext("failed to process template:")." $error]]";
        }
 
        $template->param(name => $page);