]> git.proxmox.com Git - pve-manager.git/commitdiff
vzdump: notes-template: avoid escaping meta-characters upon replace
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 3 May 2022 11:17:58 +0000 (13:17 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 May 2022 05:57:45 +0000 (07:57 +0200)
which is caused by the quoting operators \Q...\E. The actual intention
was to avoid such surprises.

Fixes: e01438a7 ("partially close #438: vzdump: support setting notes-template")
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/VZDump.pm

index 22fdb324e39df3090afd9590457865acecb36430..9af2de3dc86eb82fbe0f078a82d4cf547d341029 100644 (file)
@@ -90,7 +90,7 @@ my $generate_notes = sub {
     $notes_template =~ s/\\(.)/$unescape->($1)/eg;
 
     my $vars = join('|', keys $info->%*);
     $notes_template =~ s/\\(.)/$unescape->($1)/eg;
 
     my $vars = join('|', keys $info->%*);
-    $notes_template =~ s/\{\{($vars)\}\}/\Q$info->{$1}\E/g;
+    $notes_template =~ s/\{\{($vars)\}\}/$info->{$1}/g;
 
     die "unexpected variable name '$1'" if $notes_template =~ m/\{\{([^\s]+)\}\}/;
 
 
     die "unexpected variable name '$1'" if $notes_template =~ m/\{\{([^\s]+)\}\}/;