Discussion:
[pve-devel] [PATCH common] tools: template_replace: esacpe braces
Thomas Lamprecht
2018-11-18 15:06:19 UTC
Permalink
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 <***@proxmox.com>
---
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.19.1
Wolfgang Bumiller
2018-11-19 09:07:01 UTC
Permalink
applied
Post by Thomas Lamprecht
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.
---
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.19.1
Loading...