pecl-mail-mailparse
pecl-mail-mailparse copied to clipboard
Unexpected parsed value of content-id
Consider this php example:
<?php
header('Content-type: text/plain; Charset=UTF-8');
$mime = 'Content-ID: <Facebook_32x32(1)_aa284ba9-f148-4698-9c1f-c8e92bdb842e.png>
';
$stream = fopen("php://temp", 'r+');
fputs($stream, $mime);
// Read what we have written.
rewind($stream);
$resource = mailparse_msg_create();
while (!feof($stream)) {
mailparse_msg_parse($resource, fread($stream, 2048));
}
$part = mailparse_msg_get_part($resource, 1);
$data = mailparse_msg_get_part_data($part);
print_r($data);
die();
The expected outcome for $data->{'content-id'} is 'Facebook_32x32(1)_aa284ba9-f148-4698-9c1f-c8e92bdb842e.png', but the outcome is 'Facebook_32x32 _aa284ba9-f148-4698-9c1f-c8e92bdb842e.png'