Commit 3b4820bb authored by Shawn M Moore's avatar Shawn M Moore
Browse files

Make sure templates with missing } are correctly errors

parent aedb0138
......@@ -470,7 +470,8 @@ sub _ParseContentSimple {
TYPE => 'STRING',
SOURCE => $args{Content},
);
$template->compile;
my ($ok) = $template->compile;
return ( undef, $self->loc('Template parsing error') ) if !$ok;
# copied from Text::Template::fill_in and refactored to be simple variable
# interpolation
......
use strict;
use warnings;
use RT;
use RT::Test tests => 186;
use RT::Test tests => 196;
my $queue = RT::Queue->new($RT::SystemUser);
$queue->Load("General");
......@@ -150,6 +150,12 @@ TemplateTest(
SimpleOutput => "test { *!( }",
);
TemplateTest(
Content => "\ntest { \$rtname ",
PerlOutput => undef,
SimpleOutput => undef,
);
is($ticket->Status, 'new', "test setup");
SimpleTemplateTest(
Content => "\ntest { \$Ticket->Resolve }",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment