public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] vzdump: notes-template: avoid escaping meta-characters upon replace
Date: Tue,  3 May 2022 10:24:36 +0200	[thread overview]
Message-ID: <20220503082436.23207-1-f.ebner@proxmox.com> (raw)

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>
---
 PVE/VZDump.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index 22fdb324..9af2de3d 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -90,7 +90,7 @@ my $generate_notes = sub {
     $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]+)\}\}/;
 
-- 
2.30.2





                 reply	other threads:[~2022-05-03  8:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220503082436.23207-1-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal