]> git.proxmox.com Git - pve-common.git/commitdiff
allow to pass undefined value to template_replace
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 26 Jan 2012 05:56:56 +0000 (06:56 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 26 Jan 2012 05:56:56 +0000 (06:56 +0100)
data/PVE/Tools.pm

index dc4bbfd33f7269739dfe5ff18fe99a9098acbbdc..85b32305e85c811885c4561e68e8507ad57d94b1 100644 (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;