mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-09 08:44:18 +00:00
allow to pass undefined value to template_replace
This commit is contained in:
parent
7f0f0610ab
commit
3250f5c799
@ -454,6 +454,8 @@ sub trim {
|
|||||||
sub template_replace {
|
sub template_replace {
|
||||||
my ($tmpl, $data) = @_;
|
my ($tmpl, $data) = @_;
|
||||||
|
|
||||||
|
return $tmpl if !$tmpl;
|
||||||
|
|
||||||
my $res = '';
|
my $res = '';
|
||||||
while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) {
|
while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) {
|
||||||
$res .= $1 if $1;
|
$res .= $1 if $1;
|
||||||
|
Loading…
Reference in New Issue
Block a user