From: x2003bruneau Date: Tue, 27 Feb 2007 22:28:09 +0000 (+0000) Subject: Backport X-Git-Tag: 1.8~84 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=7995f07b8cc68bc0c319c27f7189d125d2dcd1e7;p=banana.git Backport git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@221 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/Changelog b/Changelog index 399f0f1..2e63be3 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,7 @@ +Tue, 27 Feb 2007 Florent Bruneau + + * Bugfix: accentuated headers + Sun, 25 Feb 2007 Florent Bruneau * RSS Feeds diff --git a/banana/mimepart.inc.php b/banana/mimepart.inc.php index e2fea25..9a2b503 100644 --- a/banana/mimepart.inc.php +++ b/banana/mimepart.inc.php @@ -298,9 +298,7 @@ class BananaMimePart $value = substr($value, 0, $trim); } } - if (preg_match('/[\x80-\xff]/', $value)) { - return '=?UTF-8?B?' . base64_encode($value) . '?='; - } + $value = preg_replace('/([\x80-\xff]+)/e', '"=?UTF-8?B?" . base64_encode("\1") . "?="', $value); return $value; } diff --git a/banana/page.inc.php b/banana/page.inc.php index acd2e65..1a064ff 100644 --- a/banana/page.inc.php +++ b/banana/page.inc.php @@ -184,6 +184,7 @@ class BananaPage extends Smarty $this->register_function('imglink', array($this, 'makeImgLink')); $this->register_function('img', array($this, 'makeImg')); $this->register_modifier('b', '_b_'); + $this->register_modifier('htmlentities', 'banana_htmlentities'); $this->assign('errors', $this->error); $this->assign('page', $this->page); diff --git a/banana/templates/banana-newmessage.inc.tpl b/banana/templates/banana-newmessage.inc.tpl index e730c96..67a6e0f 100644 --- a/banana/templates/banana-newmessage.inc.tpl +++ b/banana/templates/banana-newmessage.inc.tpl @@ -5,7 +5,9 @@ {foreach from=$headers key=header item=values} - {$values.name} + + {$values.name|htmlentities} + {if $values.fixed} {$values.fixed|htmlentities}