all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Dylan Whyte <d.whyte@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH pve-common] Fix 3560: gui/notes: escape % symbol when encoding
Date: Fri, 12 Nov 2021 09:43:52 +0100	[thread overview]
Message-ID: <e21ec2e0-61f0-61e6-1411-fa362b51d70d@proxmox.com> (raw)
In-Reply-To: <20210806132224.2069916-1-d.whyte@proxmox.com>

bump.

Noticed while doing some testing that this was never reviewed/applied.

On 8/6/21 3:22 PM, Dylan Whyte wrote:
> This prevents cases in which a string containing a percent character is
> inadvertently utf-8 decoded before being displayed in notes.
>
> Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
> ---
>   src/PVE/Tools.pm | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
> index 807bc03..b8d6dc9 100644
> --- a/src/PVE/Tools.pm
> +++ b/src/PVE/Tools.pm
> @@ -1200,8 +1200,8 @@ sub upid_normalize_status_type {
>   sub encode_text {
>       my ($text) = @_;
>   
> -    # all control and hi-bit characters, and ':'
> -    my $unsafe = "^\x20-\x39\x3b-\x7e";
> +    # all control and hi-bit characters, ':', and '%'
> +    my $unsafe = "\x00-\x1f\x25\x3a\x7f-\xff";
>       return uri_escape(Encode::encode("utf8", $text), $unsafe);
>   }
>   




      reply	other threads:[~2021-11-12  8:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-06 13:22 Dylan Whyte
2021-11-12  8:43 ` Dylan Whyte [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=e21ec2e0-61f0-61e6-1411-fa362b51d70d@proxmox.com \
    --to=d.whyte@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal