public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup 1/2] server/email_notifications: do not double html escape
Date: Wed, 17 Mar 2021 20:39:14 +0100	[thread overview]
Message-ID: <d482101d-4a0a-ef77-7e9d-0b48764a215a@proxmox.com> (raw)
In-Reply-To: <20210317141918.24843-1-d.csapak@proxmox.com>

On 17.03.21 15:19, Dominik Csapak wrote:
> 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));
> 

for the record: This would need "server/email_notifications: do not panic on template registration"
to be applied before, else it does not applies.




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

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 14:19 Dominik Csapak
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 ` Thomas Lamprecht [this message]

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=d482101d-4a0a-ef77-7e9d-0b48764a215a@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=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