From a3601975428c2f1b548ae04f6456e7f369244903 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 3 Dec 2008 04:57:32 -0700 Subject: [PATCH] Only add charset param if dealing with text/* part. --- framework/Mime/lib/Horde/Mime/Part.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/framework/Mime/lib/Horde/Mime/Part.php b/framework/Mime/lib/Horde/Mime/Part.php index ee0b46255..bc3a54eef 100644 --- a/framework/Mime/lib/Horde/Mime/Part.php +++ b/framework/Mime/lib/Horde/Mime/Part.php @@ -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; } -- 2.11.0