Closes #700: Encoding issues with list descriptions
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 16 Sep 2007 19:40:14 +0000 (21:40 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 16 Sep 2007 19:40:14 +0000 (21:40 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
ChangeLog
classes/mmlist.php
include/validations/listes.inc.php
modules/lists.php
modules/xnetlists.php
templates/lists/liste.inc.tpl
templates/lists/members.tpl
templates/xnetlists/index.tpl

index f31f9c0..0a3cdb2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,9 @@ Bug/Wish:
         - #688: From name in the sending form                              -FRU
         - #703: Fix management of mail adresses containing '+'             -ALK
 
+    * Lists:
+        - #700: Fix several encoding issues                                -FRU
+
     * Profile:
         - Fix GoogleMaps links                                             -FRU
         - #663: Link to Xnet's map from the "My groups" page               -FRU
index b6fe5b5..0e74f09 100644 (file)
@@ -32,11 +32,6 @@ class MMList extends XmlrpcClient
             $this->bt = new PlBacktrace('MMList');
         }
     }
-
-    public function __call($method, $args)
-    {
-        return parent::__call($method, $args);
-    }
 }
 
 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
index 8558c38..6710d4a 100644 (file)
@@ -107,7 +107,7 @@ class ListeReq extends Validate
     public function commit()
     {
         $list = new MMList(S::v('uid'), S::v('password'));
-        $ret = $list->create_list($this->liste, $this->desc, $this->advertise,
+        $ret = $list->create_list($this->liste, utf8_decode($this->desc), $this->advertise,
                                   $this->modlevel, $this->inslevel,
                                   $this->owners, $this->members);
         $liste = strtolower($this->liste);
index 89c21de..14769a3 100644 (file)
@@ -218,7 +218,7 @@ class ListsModule extends PLModule
             $page->trig('cet alias est déjà pris');
         }
 
-        if (!Post::v(desc)) {
+        if (!Post::v('desc')) {
             $page->trig('le sujet est vide');
         }
 
index 9cf8435..3013f6e 100644 (file)
@@ -140,10 +140,9 @@ class XnetListsModule extends ListsModule
         }
 
         $new = $liste.'@'.$globals->asso('mail_domain');
-        $res = XDB::query('SELECT COUNT(*) FROM x4dat.virtual WHERE alias={?}', $new);
-        $n   = $res->fetchOneCell();
+        $res = XDB::query('SELECT alias FROM x4dat.virtual WHERE alias={?}', $new);
 
-        if ($n) {
+        if ($res->numRows()) {
             $page->trig('cet alias est déjà pris');
             return;
         }
@@ -153,9 +152,9 @@ class XnetListsModule extends ListsModule
         }
 
         $ret = $this->client->create_list(
-                    $liste, Post::v('desc'), Post::v('advertise'),
+                    $liste, utf8_decode(Post::v('desc')), Post::v('advertise'),
                     Post::v('modlevel'), Post::v('inslevel'),
-                    array(S::v('forlife')), array());
+                    array(S::v('forlife')), array(S::v('forlife')));
 
         $dom = strtolower($globals->asso("mail_domain"));
         $red = $dom.'_'.$liste;
index b8bd267..d4d3d10 100644 (file)
@@ -33,7 +33,7 @@
   <a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a> 
 </td>
 <td>
-  {$liste.desc}<br/>
+  {$liste.desc|smarty:nodefaults}<br/>
   {if $liste.subscriptions|@count}
   <strong>&bull; Demandes d'inscription</strong><br />
   {foreach from=$liste.subscriptions item=s}
@@ -67,7 +67,7 @@
     <a href='{$platal->ns}lists/moderate/{$liste.list}?mid={$m.id}'>
       {icon name=magnifier title="Voir le message"}
     </a>
-    Sujet : {$m.subj|hdc|default:"[pas de sujet]"}<br />
+    Sujet : {$m.subj|hdc|smarty:nodefaults|default:"[pas de sujet]"}<br />
   {/foreach}
   </span>
   {/if}
index 7a51296..884c427 100644 (file)
@@ -34,7 +34,7 @@
   </tr>
   <tr>
     <td class='titre'> Sujet </td>
-    <td>{$details.desc}</td>
+    <td>{$details.desc|smarty:nodefaults}</td>
   </tr>
   <tr>
     <td class='titre'> Visibilité </td>
@@ -74,7 +74,7 @@
 <table class='tinybicol' cellpadding='0' cellspacing='0'>
   <tr><th colspan='2'>Informations sur la liste</th></tr>
   <tr>
-    <td colspan='2'>{$details.info|nl2br}</td>
+    <td colspan='2'>{$details.info|smarty:nodefaults|nl2br}</td>
   </tr>
 </table>
 {/if}
index 6b68210..cc3beef 100644 (file)
@@ -71,7 +71,7 @@ croix verte te permet de t'inscrire, après accord des responsables si l'inscrip
       {/if}
       <a href='{$platal->ns}lists/members/{$l.list}'>{$l.list}</a>
     </td>
-    <td>{$l.desc}</td>
+    <td>{$l.desc|smarty:nodefaults}</td>
     <td class='center'>
       {if $l.diff eq 2}modérée{elseif $l.diff eq 1}restreinte{else}libre{/if}
     </td>