unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: Jakub Wilk <jwilk@jwilk.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH] nmweb: escape subject in search view
Date: Fri, 16 Sep 2022 21:50:55 -0300	[thread overview]
Message-ID: <87mtay9634.fsf@tethera.net> (raw)
In-Reply-To: <20220905110721.1881015-1-david@tethera.net>

David Bremner <david@tethera.net> writes:

> Fix a bug reported by Jakub Wilk [1].
>
> [1]: id:20220822064717.qftn4tr7cs4r2ian@jwilk.net
> ---
>  devel/notmuch-web/nmweb.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/devel/notmuch-web/nmweb.py b/devel/notmuch-web/nmweb.py
> index 928e4863..7b555c62 100755
> --- a/devel/notmuch-web/nmweb.py
> +++ b/devel/notmuch-web/nmweb.py
> @@ -131,7 +131,7 @@ env.globals['mailto_addrs'] = mailto_addrs
>  def link_msg(msg):
>    lnk = quote_plus(msg.messageid.encode('utf8'))
>    try:
> -    subj = msg.header('Subject')
> +    subj = html.escape(msg.header('Subject'))
>    except LookupError:
>      subj = ""
>    out = '<a href="%s/show/%s">%s</a>' % (prefix, lnk, subj)
> -- 
> 2.35.2

I've deployed this patch on nmbug.notmuchmail.org. It seems to do the
right thing, at least for Jakub's original reported message.

d

  reply	other threads:[~2022-09-17  0:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22  6:47 nmweb HTML injection Jakub Wilk
2022-08-22  8:35 ` Michael J Gruber
2022-09-05 11:07 ` [PATCH] nmweb: escape subject in search view David Bremner
2022-09-17  0:50   ` David Bremner [this message]
2022-09-23 23:21   ` David Bremner

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

  List information: https://notmuchmail.org/

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

  git send-email \
    --in-reply-to=87mtay9634.fsf@tethera.net \
    --to=david@tethera.net \
    --cc=jwilk@jwilk.net \
    --cc=notmuch@notmuchmail.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).