Skip to content
Snippets Groups Projects
Commit b1a660ef authored by Jared Hancock's avatar Jared Hancock
Browse files

Fix attachments posted to pipe.php

- Handle decoding large base64 encoded attachments better
- Avoid transcoding from one charset to the same
- Avoid encoding attachments without a declared charset
parent bf1c4ce5
No related branches found
No related tags found
No related merge requests found
......@@ -45,6 +45,9 @@ class Format {
if($charset && in_array(strtolower(trim($charset)),
array('default','x-user-defined','iso')))
$charset = 'ISO-8859-1';
if (strcasecmp($charset, $encoding) === 0)
return $text;
$original = $text;
if(function_exists('iconv') && $charset)
......
......@@ -202,9 +202,14 @@ class Mail_Parse {
$file=array(
'name' => $filename,
'type' => strtolower($part->ctype_primary.'/'.$part->ctype_secondary),
'data' => $this->mime_encode($part->body, $part->ctype_parameters['charset'])
);
if ($part->ctype_parameters['charset'])
$file['data'] = $this->mime_encode($part->body,
$part->ctype_parameters['charset']);
else
$file['data'] = $part->body;
if(!$this->decode_bodies && $part->headers['content-transfer-encoding'])
$file['encoding'] = $part->headers['content-transfer-encoding'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment