Re: Mangling of /message-id/flat links

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Mangling of /message-id/flat links
Дата
Msg-id CABUevEzmU+9nUUTzqBXcQrMk8iX5V1apQioPSTovfeqyQWtfQw@mail.gmail.com
обсуждение исходный текст
Ответ на Mangling of /message-id/flat links  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-www


On Tue, Feb 2, 2016 at 10:38 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote:
Hi

The archives mangled a URL in the following message:

http://www.postgresql.org/message-id/CAEepm=03=BT=NSEbufQ6JTvWVC2fm3jyddLfUi66fn2cJ727rw@mail.gmail.com

Perhaps the pattern needs tweaking, something like this?

diff --git a/django/archives/mailarchives/templatetags/pgfilters.py
b/django/archives/mailarchives/templatetags/pgfilters.py
index 337a1a3..577ff03 100644
--- a/django/archives/mailarchives/templatetags/pgfilters.py
+++ b/django/archives/mailarchives/templatetags/pgfilters.py
@@ -23,7 +23,7 @@ def hidemail(value):
 #
 # Those are not email addresses, so ignore them. The links won't work if they
 # are mangled.
-_re_mail = re.compile('(/message-id/)?[^()<>@,;:\/\s"\'&|]+@[^()<>@,;:\/\s"\'&|]+')
+_re_mail = re.compile('(/message-id/|/message-id/flat/)?[^()<>@,;:\/\s"\'&|]+@[^()<>@,;:\/\s"\'&|]+')
 def _rewrite_email_match(match):
        if match.group(1):
                return match.group(0)   # was preceded by /message-id/

Or perhaps, instead of trying to recognise URLs that point back into
the archives, it shouldn't mangle anything that looks like a URL.

Apologies for a late response. I've been working on a tool that lets us make these changes and then do a "dry-run reapply" against existing archivse and show diffs of what changed to make it a bit more safe to make such changes. Unfortunately, that dug some old corruption in the archives, so I'm working on fixing that first. Will get back to this one later.

When you say "anything that looks like an URL", how wouldyou define that? In the form of a regexp? I agree that this might be a good idea..
 
--

В списке pgsql-www по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: editor rights for wiki
Следующее
От: Thom Brown
Дата:
Сообщение: Wiki no longer showing recent changes