Permalink
Browse files

- Fix attachment filenames broken with TNEF decoder using long filena…

…mes (#1486795)

- Use tnef_decoder class from Horde
  • Loading branch information...
1 parent 1aaeaaa commit f19d86b96da4a73efa88042dd0bcf0da1a214762 @alecpl alecpl committed Jun 15, 2010
Showing with 338 additions and 360 deletions.
  1. +1 −0 CHANGELOG
  2. +7 −8 program/include/rcube_message.php
  3. +0 −352 program/lib/tnef_decoder.inc
  4. +330 −0 program/lib/tnef_decoder.php
View
@@ -1,6 +1,7 @@
CHANGELOG RoundCube Webmail
===========================
+- Fix attachment filenames broken with TNEF decoder using long filenames (#1486795)
- Use user's timezone in Date header, not server's timezone (#1486119)
- Add option to set separate footer for HTML messages (#1486660)
- Add real SMTP error description to displayed error messages (#1485927)
@@ -500,7 +500,7 @@ private function get_mime_numbers(&$part)
{
if (strlen($part->mime_id))
$this->mime_parts[$part->mime_id] = &$part;
-
+
if (is_array($part->parts))
for ($i=0; $i<count($part->parts); $i++)
$this->get_mime_numbers($part->parts[$i]);
@@ -518,18 +518,17 @@ function tnef_decode(&$part)
if (!isset($part->body))
$part->body = $this->imap->get_message_part($this->uid, $part->mime_id, $part);
- require_once('lib/tnef_decoder.inc');
-
$parts = array();
- $tnef_arr = tnef_decode($part->body);
+ $tnef = new tnef_decoder;
+ $tnef_arr = $tnef->decompress($part->body);
foreach ($tnef_arr as $pid => $winatt) {
$tpart = new rcube_message_part;
$tpart->filename = trim($winatt['name']);
$tpart->encoding = 'stream';
- $tpart->ctype_primary = trim(strtolower($winatt['type0']));
- $tpart->ctype_secondary = trim(strtolower($winatt['type1']));
+ $tpart->ctype_primary = trim(strtolower($winatt['type']));
+ $tpart->ctype_secondary = trim(strtolower($winatt['subtype']));
$tpart->mimetype = $tpart->ctype_primary . '/' . $tpart->ctype_secondary;
$tpart->mime_id = 'winmail.' . $part->mime_id . '.' . $pid;
$tpart->size = $winatt['size'];
@@ -538,7 +537,7 @@ function tnef_decode(&$part)
$parts[] = $tpart;
unset($tnef_arr[$pid]);
}
-
+
return $parts;
}
@@ -584,7 +583,7 @@ function uu_decode(&$part)
unset($matches[$pid]);
}
}
-
+
return $parts;
}
Oops, something went wrong.

0 comments on commit f19d86b

Please sign in to comment.