Skip to content
Snippets Groups Projects
Commit db0190a2 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #607 from greezybacon/issue/corrupt-piped-attachments


Fix attachments posted to pipe.php

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 98982c46 b1a660ef
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.
Finish editing this message first!
Please register or to comment