ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     --TEST--
GH issue #20 (Unexpected parsed value of content-id with parentheses)
--SKIPIF--
<?php
if (!extension_loaded("mailparse")) die("skip mailparse extension not available");
?>
--FILE--
<?php
$mime = "Content-Type: image/png\r\n" .
    "Content-Transfer-Encoding: base64\r\n" .
    "Content-ID: <Facebook_32x32(1)_aa284ba9-f148-4698-9c1f-c8e92bdb842e.png>\r\n" .
    "\r\n" .
    "iVBOR\r\n";

$resource = mailparse_msg_create();
mailparse_msg_parse($resource, $mime);

$part = mailparse_msg_get_part($resource, 1);
$data = mailparse_msg_get_part_data($part);

echo "content-id: " . $data['content-id'] . "\n";

/* Also test bare content-id without angle brackets */
$mime2 = "Content-Type: image/png\r\n" .
    "Content-Transfer-Encoding: base64\r\n" .
    "Content-ID: Facebook_32x32(1)_test.png\r\n" .
    "\r\n" .
    "iVBOR\r\n";

$resource2 = mailparse_msg_create();
mailparse_msg_parse($resource2, $mime2);

$part2 = mailparse_msg_get_part($resource2, 1);
$data2 = mailparse_msg_get_part_data($part2);

echo "content-id bare: " . $data2['content-id'] . "\n";

/* Standard RFC-compliant content-id */
$mime3 = "Content-Type: image/png\r\n" .
    "Content-ID: <part1@example.com>\r\n" .
    "\r\n" .
    "iVBOR\r\n";

$resource3 = mailparse_msg_create();
mailparse_msg_parse($resource3, $mime3);

$part3 = mailparse_msg_get_part($resource3, 1);
$data3 = mailparse_msg_get_part_data($part3);

echo "content-id rfc: " . $data3['content-id'] . "\n";

/* RFC-compliant content-id with trailing comment */
$mime4 = "Content-Type: image/png\r\n" .
    "Content-ID: <part1@example.com> (comment)\r\n" .
    "\r\n" .
    "iVBOR\r\n";

$resource4 = mailparse_msg_create();
mailparse_msg_parse($resource4, $mime4);

$part4 = mailparse_msg_get_part($resource4, 1);
$data4 = mailparse_msg_get_part_data($part4);

echo "content-id trailing comment: " . $data4['content-id'] . "\n";

/* Duplicate Content-ID headers (stored as array internally) */
$mime5 = "Content-Type: image/png\r\n" .
    "Content-ID: <first@example.com>\r\n" .
    "Content-ID: <second@example.com>\r\n" .
    "\r\n" .
    "iVBOR\r\n";

$resource5 = mailparse_msg_create();
mailparse_msg_parse($resource5, $mime5);

$part5 = mailparse_msg_get_part($resource5, 1);
$data5 = mailparse_msg_get_part_data($part5);

echo "content-id duplicate: " . $data5['content-id'] . "\n";

echo "ok\n";
?>
--EXPECT--
content-id: Facebook_32x32(1)_aa284ba9-f148-4698-9c1f-c8e92bdb842e.png
content-id bare: Facebook_32x32(1)_test.png
content-id rfc: part1@example.com
content-id trailing comment: part1@example.com
content-id duplicate: first@example.com
ok
