vzdump: notes-template: avoid escaping meta-characters upon replace
which is caused by the quoting operators \Q...\E. The actual intention was to avoid such surprises. Fixes: 413bb432 ("partially close #438: vzdump: support setting notes-template") Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
20b0b2f3b6
commit
ba055afb23
@ -90,7 +90,7 @@ my $generate_notes = sub {
|
|||||||
$notes_template =~ s/\\(.)/$unescape->($1)/eg;
|
$notes_template =~ s/\\(.)/$unescape->($1)/eg;
|
||||||
|
|
||||||
my $vars = join('|', keys $info->%*);
|
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]+)\}\}/;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user