Backport
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Tue, 27 Feb 2007 22:28:09 +0000 (22:28 +0000)
committerx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Tue, 27 Feb 2007 22:28:09 +0000 (22:28 +0000)
git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@221 9869982d-c50d-0410-be91-f2a2ec7c7c7b

Changelog
banana/mimepart.inc.php
banana/page.inc.php
banana/templates/banana-newmessage.inc.tpl

index 399f0f1..2e63be3 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,7 @@
+Tue, 27 Feb 2007                    Florent Bruneau <florent.bruneau@m4x.org>
+
+       * Bugfix: accentuated headers
+
 Sun, 25 Feb 2007                    Florent Bruneau <florent.bruneau@m4x.org>
 
        * RSS Feeds
index e2fea25..9a2b503 100644 (file)
@@ -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;
     }
 
index acd2e65..1a064ff 100644 (file)
@@ -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);
index e730c96..67a6e0f 100644 (file)
@@ -5,7 +5,9 @@
     </tr>
     {foreach from=$headers key=header item=values}
     <tr class="pair">
-      <td>{$values.name}</td>
+      <td>
+        {$values.name|htmlentities}
+      </td>
       <td>
         {if $values.fixed}
         {$values.fixed|htmlentities}