| 497 |
$header->id=$value; |
$header->id=$value; |
| 498 |
break; |
break; |
| 499 |
case "subject:": |
case "subject:": |
| 500 |
$header->subject=headerDecode($value); |
$header->subject = decode_unstructured_body($value); |
| 501 |
break; |
break; |
| 502 |
case "newsgroups:": |
case "newsgroups:": |
| 503 |
$header->newsgroups=$value; |
$header->newsgroups=$value; |
| 565 |
return $header; |
return $header; |
| 566 |
} |
} |
| 567 |
|
|
| 568 |
|
function decode_unstructured_body ($body) { |
| 569 |
|
$patterns = array ( |
| 570 |
|
"/(=\\?[^\\x00-\\x20()<>@,;:\\\\\"/\\[\\]?.=\\x7F]+\\?[BQ]\\?[^\\x00-\\x20\\x3F\\x7F]*\\?=)/ei", |
| 571 |
|
); |
| 572 |
|
$replace = array ( |
| 573 |
|
"mb_decode_mimeheader('\\1')", |
| 574 |
|
); |
| 575 |
|
return preg_replace ($patterns, $replace, $body); |
| 576 |
|
} |
| 577 |
|
|
| 578 |
function decode_structured_body ($body) { |
function decode_structured_body ($body) { |
| 579 |
$patterns = array ( |
$patterns = array ( |
| 580 |
"/\"((?:[^\"\\\\]+|\\\\.)*)\"/e", |
"/\"((?:[^\"\\\\]+|\\\\.)*)\"/e", |
| 581 |
"/\(((?:[^)\\\\]+|\\\\.)*)\)/e", |
"/\(((?:[^()\\\\]+|\\\\.|(?:\((?:[^()\\\\]+|\\\\.|(?:\((?:[^)\\\\]+|\\\\.\ |
| 582 |
|
)*\)))*\)))*)\)/e", |
| 583 |
); |
); |
| 584 |
$replace = array ( |
$replace = array ( |
| 585 |
"mb_convert_encoding(decode_quoted_pair('\\1'), 'EUC-JP', 'auto')", |
"mb_convert_encoding(decode_quoted_pair('\\1'), 'EUC-JP', 'auto')", |