Accept quoted charset names (charset="mycharset" instead of charset=mycharset)
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Tue, 11 Jul 2006 18:26:07 +0000 (18:26 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:52 +0000 (00:34 +0100)
Compatible with m$ Entourage

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@79 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/post.inc.php

index 8262285..09c2a0a 100644 (file)
@@ -196,7 +196,7 @@ class BananaPost
      */
     function _fix_charset()
     {
-        if (preg_match('!charset=([^;]*)\s*(;|$)!', $this->headers['content-type'], $matches)) {
+        if (preg_match('!charset="?([^;"]*)"?\s*(;|$)?!', $this->headers['content-type'], $matches)) {
             $body = iconv($matches[1], 'utf-8', $this->body);
             if (strlen($body) == 0) {
                 return false;