[Tickets #11390] tnef: UTF-16 encoded mime type not recognized

bugs at horde.org bugs at horde.org
Fri Aug 31 17:20:49 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11390
------------------------------------------------------------------------------
  Ticket             | 11390
  Created By         | andrey012 at gmail.com
  Summary            | tnef: UTF-16 encoded mime type not recognized
  Queue              | IMP
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


andrey012 at gmail.com (2012-08-31 17:20) wrote:

when mime-type (and other properties) are UTF-16 encoded -- zeroes in  
type are not stripped correctly.

Here is piece of existing code:
             case self::MAPI_ATTACH_MIME_TAG:
                 /* Is this ever set, and what is format? */
                 $attachment_data[0]['type'] =  
preg_replace('/^(.*)\/.*/', '\1', $value);
                 $attachment_data[0]['subtype'] =  
preg_replace('/.*\/(.*)$/', '\1', $value);
                 $attachment_data[0]['subtype'] = str_replace("\0",  
'', $attachment_data[0]['subtype']);

You can see that zeroes are stripped in subtype but not in type.
AS a result JPEGs appear to be x-unknown/jpeg instead of image/jpeg






More information about the bugs mailing list