allow to pass undefined value to template_replace

This commit is contained in:
Dietmar Maurer 2012-01-26 06:56:56 +01:00
parent 7f0f0610ab
commit 3250f5c799

View File

@ -454,6 +454,8 @@ sub trim {
sub template_replace {
my ($tmpl, $data) = @_;
return $tmpl if !$tmpl;
my $res = '';
while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) {
$res .= $1 if $1;