X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FTemplate.pm;h=050799714ad1e0ee302eb38920d0c6ad392986af;hp=d15c1cdcb4f0b35d90415fe40c8fd57bc2754dcb;hb=0ea23112cfa0d82738b0f08d60d90579721b7524;hpb=60dd95422a1ad4724e0c5d9dd7f8e8878cd96aa8

diff --git a/rt/lib/RT/Template.pm b/rt/lib/RT/Template.pm
index d15c1cdcb..050799714 100755
--- a/rt/lib/RT/Template.pm
+++ b/rt/lib/RT/Template.pm
@@ -470,6 +470,12 @@ sub _ParseContentPerl {
         TYPE   => 'STRING',
         SOURCE => $args{Content},
     );
+    my ($ok) = $template->compile;
+    unless ($ok) {
+        $RT::Logger->error("Template parsing error in @{[$self->Name]} (#@{[$self->id]}): $Text::Template::ERROR");
+        return ( undef, $self->loc('Template parsing error: [_1]', $Text::Template::ERROR) );
+    }
+
     my $is_broken = 0;
     my $retval = $template->fill_in(
         HASH => $args{TemplateArgs},