From 17793ccf1af9c3d8b7e294299fe0a7b5af07cc92 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Wed, 10 Oct 2007 22:02:12 +0200 Subject: [PATCH] Fix payment comment decoder --- modules/payment.php | 11 +++++++++++ templates/payment/xnet.tpl | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/payment.php b/modules/payment.php index d71b26d..ca19fb2 100644 --- a/modules/payment.php +++ b/modules/payment.php @@ -71,6 +71,16 @@ function cle_accept($d1,$d2,$d3,$d4,$d5) return $alpha{$n-1}.$m1.$m2.$m3.$m4; } +/* decode the comment */ +function comment_decode($comment) { + $comment = urldecode($comment); + if (is_utf8($comment)) { + return $comment; + } else { + return utf8_encode($comment); + } +} + class PaymentModule extends PLModule { @@ -448,6 +458,7 @@ class PaymentModule extends PLModule $event[$pid]['paid'] += trim($p); } } + $page->register_modifier('decode_comment', 'decode_comment'); $page->assign('trans', $trans); $page->assign('event', $event); } diff --git a/templates/payment/xnet.tpl b/templates/payment/xnet.tpl index 74ad3f5..076c1fa 100644 --- a/templates/payment/xnet.tpl +++ b/templates/payment/xnet.tpl @@ -122,7 +122,7 @@ Voici la liste des paiements en ligne possible pour le groupe {$asso.nom} {icon name=email title="mail"} {$p.promo} - {$p.comment|urldecode} + {$p.comment|comment_decode} {$p.montant} {elseif $smarty.foreach.people.first} -- 2.1.4