allow non-hash values in arrays, valid in TT templates
This commit is contained in:
parent
ad3231af73
commit
4a43f9fafb
1 changed files with 5 additions and 0 deletions
|
|
@ -27,7 +27,12 @@ sub _rewriteVars { # replace dots with underscrores in keys (except in keys that
|
|||
$newKey =~ s/\./_/g if $newKey !~ /\//;
|
||||
if ( ref $vars->{$key} eq 'ARRAY') {
|
||||
foreach my $entry (@{$vars->{$key}}) {
|
||||
if ( ref $entry eq 'HASH' ) {
|
||||
push(@{$newVars->{$newKey}}, _rewriteVars($entry));
|
||||
}
|
||||
else {
|
||||
push(@{$newVars->{$newKey}}, $entry );
|
||||
}
|
||||
}
|
||||
} elsif(ref $vars->{$key} eq 'HASH') {
|
||||
$newVars->{$newKey} = _rewriteVars($vars->{$key});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue