Only add charset param if dealing with text/* part.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Dec 2008 11:57:32 +0000 (04:57 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 3 Dec 2008 18:27:09 +0000 (11:27 -0700)
framework/Mime/lib/Horde/Mime/Part.php

index ee0b462..bc3a54e 100644 (file)
@@ -741,7 +741,12 @@ class Horde_Mime_Part
         }
 
         /* Get the Content-Type itself. */
-        $headers->replaceHeader('Content-Type', $this->getType(), array('params' => $this->getAllContentTypeParameters()));
+        $ptype = $this->getPrimaryType();
+        $c_params = $this->getAllContentTypeParameters();
+        if ($ptype != 'text') {
+            unset($c_params['charset']);
+        }
+        $headers->replaceHeader('Content-Type', $this->getType(), array('params' => $c_params));
 
         /* Get the description, if any. */
         if (($descrip = $this->getDescription())) {
@@ -754,7 +759,6 @@ class Horde_Mime_Part
         }
 
         /* message/* parts require no additional header information. */
-        $ptype = $this->getPrimaryType();
         if ($ptype == 'message') {
             return $headers;
         }