From: Dietmar Maurer Date: Thu, 26 Jan 2012 05:56:56 +0000 (+0100) Subject: allow to pass undefined value to template_replace X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=3250f5c79906762177bc45dd9f9400fb910bbc6b;hp=7f0f0610ab82df7034eb41c44fb310d5aff10438 allow to pass undefined value to template_replace --- diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm index dc4bbfd..85b3230 100644 --- a/data/PVE/Tools.pm +++ b/data/PVE/Tools.pm @@ -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;