Re: Mangling mail archive "flat" links - Mailing list pgsql-www

From Magnus Hagander
Subject Re: Mangling mail archive "flat" links
Date
Msg-id CABUevExmn8iy+Z3-Q5t_pVtQwL81nmH4YwOv8BjOhv2uZT__QA@mail.gmail.com
Whole thread Raw
In response to Mangling mail archive "flat" links  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-www
On Mon, Aug 31, 2020 at 3:49 AM Thomas Munro <thomas.munro@gmail.com> wrote:
Hello,

It would be very nice if the archives didn't corrupt URLs like the one
at the bottom of this message:

https://www.postgresql.org/message-id/CA%2BhUKGJ8NRsqgkZEnsnRc2MFROBV-jCnacbYvtpptK2A9YYp9Q%40mail.gmail.com

I peeked in pgfilters.py and saw that there is a regular expression
designed to avoid mangling archives URLs, but it apparently doesn't
match the "flat" ones.

Yeah, that's clearly not great. I think this fix to ther regex is the right thing, it won't end up randomly missing other things now will it:

-_re_mail = re.compile(r'(/m(essage-id)?/)?[^()<>@,;:\/\s"\'&|]+@[^()<>@,;:\/\s"\'&|]+')
+_re_mail = re.compile(r'(/m(essage-id)?/(flat/)?)?[^()<>@,;:\/\s"\'&|]+@[^()<>@,;:\/\s"\'&|]+')

(it does still work for the ones I tested, but just to be on the safe side..)

--

pgsql-www by date:

Previous
From: Thomas Munro
Date:
Subject: Mangling mail archive "flat" links
Next
From: Gregory
Date:
Subject: Wiki editor request