Use transfer encoding in MIME part if specifically set
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 8 Sep 2010 18:56:29 +0000 (12:56 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 8 Sep 2010 18:58:16 +0000 (12:58 -0600)
For types other than multipart (which is always 7bit) and text (which is
handled separately), use the transfer encoding given if it is different
than the default.

framework/Mime/lib/Horde/Mime/Part.php

index 5b38b80..3feba8b 100644 (file)
@@ -1187,9 +1187,15 @@ class Horde_Mime_Part
                 break;
 
             default:
-                $encoding = ($encode & self::ENCODE_8BIT || $encode & self::ENCODE_BINARY)
-                    ? '8bit'
-                    : 'base64';
+                /* If transfer encoding has changed from the default, use that
+                 * value. */
+                if ($this->_transferEncoding != self::DEFAULT_ENCODING) {
+                    $encoding = $this->_transferEncoding;
+                } else {
+                    $encoding = ($encode & self::ENCODE_8BIT || $encode & self::ENCODE_BINARY)
+                        ? '8bit'
+                        : 'base64';
+                }
                 break;
             }