Fix message preview formatting
authorx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 28 Jul 2006 13:16:25 +0000 (13:16 +0000)
committerx2003bruneau <x2003bruneau@839d8a87-29fc-0310-9880-83ba4fa771e5>
Fri, 28 Jul 2006 13:16:25 +0000 (13:16 +0000)
* 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
bin/lists.rpc.py
modules/lists.php
templates/listes/moderate.tpl
templates/listes/moderate_mail.tpl

index 2497918..7befda6 100644 (file)
--- 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
index ade8a0e..5003ad3 100755 (executable)
@@ -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('&', '&amp;').replace('>', '&gt;').replace('<', '&lt;'))
+    h = str('').join(re.split('[\x00-\x09\x0B\x1f]+', s))
+    return Utils.uquote(h.replace('&', '&amp;').replace('>', '&gt;').replace('<', '&lt;')) 
 
 def to_forlife(email):
     try:
index 871a1ec..f8b9aa0 100644 (file)
@@ -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,'');
index 612a111..a7ffe24 100644 (file)
@@ -85,7 +85,7 @@
   {foreach from=$mails item=m}
   <tr class='{cycle values="pair,impair"}'>
     <td>{$m.sender}</td>
-    <td>{$m.subj|default:"[pas de sujet]"}</td>
+    <td>{$m.subj|hdc|default:"[pas de sujet]"}</td>
     <td class='right'>{$m.size}o</td>
     <td class='right'>{$m.stamp|date_format:"%X<br />%x"}</td>
     <td class='action'>
index c72e312..e0ea4b7 100644 (file)
 <table class='tinybicol' cellpadding='0' cellspacing='0'>
   <tr>
     <td class='titre'>émetteur</td>
-    <td>{$mail.sender}</td>
+    <td>{mailto address=$mail.sender}</td>
   </tr>
   <tr>
     <td class='titre'>sujet</td>
-    <td>{$mail.subj}</td>
+    <td>{$mail.subj|hdc}</td>
   </tr>
   <tr>
     <td class='titre'>taille</td>