/[suikacvs]/messaging/newsportal/newsportal.php
Suika

Diff of /messaging/newsportal/newsportal.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by wakaba, Sat Dec 1 15:32:13 2001 UTC revision 1.26 by wakaba, Sun Dec 2 00:08:29 2001 UTC
# Line 497  function parse_header($hdr,$number="") { Line 497  function parse_header($hdr,$number="") {
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;
# Line 565  function parse_header($hdr,$number="") { Line 565  function parse_header($hdr,$number="") {
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')",

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24