| 503 |
$header->newsgroups=$value; |
$header->newsgroups=$value; |
| 504 |
break; |
break; |
| 505 |
case "organization:": |
case "organization:": |
| 506 |
$header->organization=$value; |
$header->organization = decode_unstructured_body($value); |
| 507 |
break; |
break; |
| 508 |
case "content-transfer-encoding:": |
case "content-transfer-encoding:": |
| 509 |
$header->content_transfer_encoding=trim(strtolower($value)); |
$header->content_transfer_encoding=trim(strtolower($value)); |
| 550 |
case "x-newsreader:": |
case "x-newsreader:": |
| 551 |
case "x-mailer:": |
case "x-mailer:": |
| 552 |
case "user-agent:": |
case "user-agent:": |
| 553 |
$header->user_agent=trim(decode_structured_body($value)); |
$header->user_agent= decode_structured_body($value); |
| 554 |
|
break; |
| 555 |
|
case "x-moe:": |
| 556 |
|
$header->x_moe= decode_structured_body($value); |
| 557 |
break; |
break; |
| 558 |
case "x-face:": |
case "x-face:": |
| 559 |
// echo "<p>-".base64_decode($value)."-</p>"; |
// echo "<p>-".base64_decode($value)."-</p>"; |
| 570 |
|
|
| 571 |
function decode_unstructured_body ($body) { |
function decode_unstructured_body ($body) { |
| 572 |
$patterns = array ( |
$patterns = array ( |
| 573 |
"/(=\\?[^\\x00-\\x20()<>@,;:\\\\\"/\\[\\]?.=\\x7F]+\\?[BQ]\\?[^\\x00-\\x20\\x3F\\x7F]*\\?=)/ei", |
"/(=\\?[^\\x00-\\x20()<>@,;:\\\"\\/\\[\\]?.=\\x7F]+\\?[BQ]\\?[^\\x00-\\x20\\x3F\\x7F]*\\?=)/ei", |
| 574 |
); |
); |
| 575 |
$replace = array ( |
$replace = array ( |
| 576 |
"mb_decode_mimeheader('\\1')", |
"mb_decode_mimeheader('\\1')", |
| 577 |
); |
); |
| 578 |
return preg_replace ($patterns, $replace, $body); |
return preg_replace ($patterns, $replace, |
| 579 |
|
mb_convert_encoding($body, "EUC-JP", "auto")); |
| 580 |
} |
} |
| 581 |
|
|
| 582 |
function decode_structured_body ($body) { |
function decode_structured_body ($body) { |
| 1530 |
echo "<!-- User-Agent: ".htmlspecialchars($head->user_agent)." -->\n"; |
echo "<!-- User-Agent: ".htmlspecialchars($head->user_agent)." -->\n"; |
| 1531 |
} |
} |
| 1532 |
} |
} |
| 1533 |
|
if (isset($head->x_moe)) { |
| 1534 |
|
if ((isset($article_show["X-Moe"])) && ($article_show["X-Moe"])) { |
| 1535 |
|
echo "<span class=\"field x-moe\"><span class=\"name\">".$text_header["X-Moe"] |
| 1536 |
|
."</span> <span class=\"body\">" |
| 1537 |
|
.htmlspecialchars($head->x_moe)."</span>\n"; |
| 1538 |
|
} |
| 1539 |
|
} |
| 1540 |
if ((isset($attachment_show)) && ($attachment_show==true) && |
if ((isset($attachment_show)) && ($attachment_show==true) && |
| 1541 |
(isset($head->content_type[1]))) { |
(isset($head->content_type[1]))) { |
| 1542 |
echo $text_header["attachments"]; |
echo $text_header["attachments"]; |