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

Merge pull request #575 from greezybacon/issue/tnef-null-term-attach-names


tnef: Strip null bytes from attachment filenames

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents bfc2b7c4 2e106265
No related branches found
No related tags found
No related merge requests found
......@@ -215,6 +215,7 @@ class TnefAttribute {
const AttachFilename = 0x3704;
const AttachLongFilename = 0x3707;
const AttachPathname = 0x3708;
const AttachTransportName = 0x370c;
const AttachMimeTag = 0x370e; # Mime content-type
const AttachContentId = 0x3712;
const AttachmentCharset = 0x371b;
......@@ -486,7 +487,7 @@ class TnefStreamParser {
new TnefAttributeStreamReader($info['data']));
break;
case self::attAttachTransportFilename:
$attach->_setFilename($info['data']);
$attach->_setFilename(rtrim($info['data'], "\x00"));
break;
case self::attAttachData:
$attach->_setData($info['data']);
......@@ -576,6 +577,8 @@ class TnefAttachment extends AbstractTnefObject {
return basename($this->AttachLongFilename);
elseif (isset($this->AttachFilename))
return $this->AttachFilename;
elseif (isset($this->AttachTransportName))
return $this->AttachTransportName;
else
return $this->TransportFilename;
}
......
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