Fix issues with accentuated From
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Tue, 27 Feb 2007 22:24:49 +0000 (22:24 +0000)
committerx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Tue, 27 Feb 2007 22:24:49 +0000 (22:24 +0000)
git-svn-id: svn+ssh://murphy/home/svn/banana/branches/banana-1.5@220 9869982d-c50d-0410-be91-f2a2ec7c7c7b

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

index cf1e94a..fbbfb0d 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 dcdfb67..fbdf4b6 100644 (file)
@@ -158,6 +158,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 853e785..1f7dc77 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}