mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-06 21:58:49 +00:00
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 <t.lamprecht@proxmox.com>
This commit is contained in:
parent
0681aa7157
commit
14410e5f20
@ -670,7 +670,7 @@ sub template_replace {
|
|||||||
return $tmpl if !$tmpl;
|
return $tmpl if !$tmpl;
|
||||||
|
|
||||||
my $res = '';
|
my $res = '';
|
||||||
while ($tmpl =~ m/([^{]+)?({([^}]+)})?/g) {
|
while ($tmpl =~ m/([^{]+)?(\{([^}]+)\})?/g) {
|
||||||
$res .= $1 if $1;
|
$res .= $1 if $1;
|
||||||
$res .= ($data->{$3} || '-') if $2;
|
$res .= ($data->{$3} || '-') if $2;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user