Обсуждение: Mangling mail archive "flat" links
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. Thanks!
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"\'&|]+')
+_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..)