From 92144f3e3b3399da3acbb7c80c096a0966870a69 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 16 Sep 2007 21:40:14 +0200 Subject: [PATCH] Closes #700: Encoding issues with list descriptions Signed-off-by: Florent Bruneau --- ChangeLog | 3 +++ classes/mmlist.php | 5 ----- include/validations/listes.inc.php | 2 +- modules/lists.php | 2 +- modules/xnetlists.php | 9 ++++----- templates/lists/liste.inc.tpl | 4 ++-- templates/lists/members.tpl | 4 ++-- templates/xnetlists/index.tpl | 2 +- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index f31f9c0..0a3cdb2 100644 --- 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 diff --git a/classes/mmlist.php b/classes/mmlist.php index b6fe5b5..0e74f09 100644 --- a/classes/mmlist.php +++ b/classes/mmlist.php @@ -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: diff --git a/include/validations/listes.inc.php b/include/validations/listes.inc.php index 8558c38..6710d4a 100644 --- a/include/validations/listes.inc.php +++ b/include/validations/listes.inc.php @@ -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); diff --git a/modules/lists.php b/modules/lists.php index 89c21de..14769a3 100644 --- a/modules/lists.php +++ b/modules/lists.php @@ -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'); } diff --git a/modules/xnetlists.php b/modules/xnetlists.php index 9cf8435..3013f6e 100644 --- a/modules/xnetlists.php +++ b/modules/xnetlists.php @@ -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; diff --git a/templates/lists/liste.inc.tpl b/templates/lists/liste.inc.tpl index b8bd267..d4d3d10 100644 --- a/templates/lists/liste.inc.tpl +++ b/templates/lists/liste.inc.tpl @@ -33,7 +33,7 @@ {$liste.list} - {$liste.desc}
+ {$liste.desc|smarty:nodefaults}
{if $liste.subscriptions|@count} • Demandes d'inscription
{foreach from=$liste.subscriptions item=s} @@ -67,7 +67,7 @@ {icon name=magnifier title="Voir le message"} - Sujet : {$m.subj|hdc|default:"[pas de sujet]"}
+ Sujet : {$m.subj|hdc|smarty:nodefaults|default:"[pas de sujet]"}
{/foreach} {/if} diff --git a/templates/lists/members.tpl b/templates/lists/members.tpl index 7a51296..884c427 100644 --- a/templates/lists/members.tpl +++ b/templates/lists/members.tpl @@ -34,7 +34,7 @@ Sujet - {$details.desc} + {$details.desc|smarty:nodefaults} Visibilité @@ -74,7 +74,7 @@ - +
Informations sur la liste
{$details.info|nl2br}{$details.info|smarty:nodefaults|nl2br}
{/if} diff --git a/templates/xnetlists/index.tpl b/templates/xnetlists/index.tpl index 6b68210..cc3beef 100644 --- a/templates/xnetlists/index.tpl +++ b/templates/xnetlists/index.tpl @@ -71,7 +71,7 @@ croix verte te permet de t'inscrire, après accord des responsables si l'inscrip {/if} {$l.list} - {$l.desc} + {$l.desc|smarty:nodefaults} {if $l.diff eq 2}modérée{elseif $l.diff eq 1}restreinte{else}libre{/if} -- 2.1.4