public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] server/email_notifications: do not double html escape
Date: Wed, 17 Mar 2021 15:19:17 +0100	[thread overview]
Message-ID: <20210317141918.24843-1-d.csapak@proxmox.com> (raw)

the default escape handler is handlebars::html_escape, but this are
plain text emails and we manually escape them for the html part, so
set the default escape handler to 'no_escape'

this avoids double html escape for the characters: '&"<>' in emails

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 src/server/email_notifications.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/server/email_notifications.rs b/src/server/email_notifications.rs
index 70e13053..2acee538 100644
--- a/src/server/email_notifications.rs
+++ b/src/server/email_notifications.rs
@@ -194,6 +194,7 @@ lazy_static::lazy_static!{
         let result: Result<(), TemplateError> = try_block!({
 
             hb.set_strict_mode(true);
+            hb.register_escape_fn(handlebars::no_escape);
 
             hb.register_helper("human-bytes", Box::new(handlebars_humam_bytes_helper));
             hb.register_helper("relative-percentage", Box::new(handlebars_relative_percentage_helper));
-- 
2.20.1





             reply	other threads:[~2021-03-17 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 14:19 Dominik Csapak [this message]
2021-03-17 14:19 ` [pbs-devel] [PATCH proxmox-backup 2/2] tools/subscription: ignore ENOENT for apt auth config removal Dominik Csapak
2021-03-17 19:38   ` [pbs-devel] applied: " Thomas Lamprecht
2021-03-17 19:39 ` [pbs-devel] [PATCH proxmox-backup 1/2] server/email_notifications: do not double html escape Thomas Lamprecht

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=20210317141918.24843-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-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