From c85297061a317f47d8293e079badd998ecab9b4e Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Fri, 28 Jul 2006 13:16:25 +0000 Subject: [PATCH] Fix message preview formatting * Import some code from banana (list_header_decode) * rpc do not remove 0x0A (\n) anymore git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@689 839d8a87-29fc-0310-9880-83ba4fa771e5 --- ChangeLog | 1 + bin/lists.rpc.py | 5 ++--- modules/lists.php | 1 + templates/listes/moderate.tpl | 2 +- templates/listes/moderate_mail.tpl | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2497918..7befda6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,7 @@ New: * Lists: - Switch to the new URI scheme. -MC + - Do not remove line breaks in message moderation preview -FRU * Marketing: - Switch to the new URI scheme. -MC diff --git a/bin/lists.rpc.py b/bin/lists.rpc.py index ade8a0e..5003ad3 100755 --- a/bin/lists.rpc.py +++ b/bin/lists.rpc.py @@ -64,7 +64,6 @@ def get_config(sec, val, default=None): else: return default -BASEURL = get_config('Core', 'baseurl') MYSQL_USER = get_config('Core', 'dbuser') MYSQL_PASS = get_config('Core', 'dbpwd') @@ -171,8 +170,8 @@ def quote(s, is_header=False): h = Utils.oneline(s, 'iso-8859-1') else: h = s - h = str('').join(re.split('[\x00-\x1f]+', s)) - return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<')) + h = str('').join(re.split('[\x00-\x09\x0B\x1f]+', s)) + return Utils.uquote(h.replace('&', '&').replace('>', '>').replace('<', '<')) def to_forlife(email): try: diff --git a/modules/lists.php b/modules/lists.php index 871a1ec..f8b9aa0 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -310,6 +310,7 @@ class ListsModule extends PLModule $page->changeTpl('listes/moderate.tpl'); $page->register_modifier('qpd', 'quoted_printable_decode'); + $page->register_modifier('hdc', 'list_header_decode'); if (Env::has('sadd')) { /* 4 = SUBSCRIBE */ $this->client->handle_request($liste,Env::v('sadd'),4,''); diff --git a/templates/listes/moderate.tpl b/templates/listes/moderate.tpl index 612a111..a7ffe24 100644 --- a/templates/listes/moderate.tpl +++ b/templates/listes/moderate.tpl @@ -85,7 +85,7 @@ {foreach from=$mails item=m} {$m.sender} - {$m.subj|default:"[pas de sujet]"} + {$m.subj|hdc|default:"[pas de sujet]"} {$m.size}o {$m.stamp|date_format:"%X
%x"} diff --git a/templates/listes/moderate_mail.tpl b/templates/listes/moderate_mail.tpl index c72e312..e0ea4b7 100644 --- a/templates/listes/moderate_mail.tpl +++ b/templates/listes/moderate_mail.tpl @@ -28,11 +28,11 @@ - + - + -- 2.1.4
émetteur{$mail.sender}{mailto address=$mail.sender}
sujet{$mail.subj}{$mail.subj|hdc}
taille