From 14410e5f204ac17373c6eae07986bb2fd787701c Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sun, 18 Nov 2018 16:06:19 +0100 Subject: [PATCH] tools: template_replace: esacpe braces To avoid warnings (and in the future, errors) like: > Unescaped left brace in regex is deprecated here (and will be fatal > in Perl 5.32), passed through in regex; marked by <-- HERE in > m/([^{]+)?({ <-- HERE ([^}]+)})?/ at /usr/share/perl5/PVE/Tools.pm > line 673. with future perl versions, like Debian Buster for example has. Signed-off-by: Thomas Lamprecht --- src/PVE/Tools.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 6254b2e..0f31fdb 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -670,7 +670,7 @@ sub template_replace { return $tmpl if !$tmpl; my $res = ''; - while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) { + while ($tmpl =~ m/([^{]+)?(\{([^}]+)\})?/g) { $res .= $1 if $1; $res .= ($data->{$3} || '-') if $2; } -- 2.39.2