448 |
$newvalue=headerDecode($newvalue); // maybe there are more encoded |
$newvalue=headerDecode($newvalue); // maybe there are more encoded |
449 |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); // parts |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); // parts |
450 |
} else { |
} else { |
451 |
if (eregi('".*"',$value)) { // quoted-printable decoding |
if (eregi('".*"',$value)) { // quoted-pair |
452 |
$result1=eregi_replace('(.*)"(.*)"(.*)','\1',$value); |
$newvalue=ereg_replace('(.*)"(.*)"(.*)','\1'.decode_quoted_pair('\2').'\3',$value); |
453 |
$result2=eregi_replace('(.*)"(.*)"(.*)','\2',$value); |
return(mb_convert_encoding($newvalue, "EUC-JP", "auto")); |
|
$result3=eregi_replace('(.*)"(.*)"(.*)','\3',$value); |
|
|
$result2=eregi_replace('\\(.)','\1',$result2); |
|
|
$newvalue=$result1.$result2.$result3; |
|
|
return(mb_convert_encoding("aiueo", "EUC-JP", "auto")); |
|
454 |
} else { // there wasn't anything encoded, return the original string |
} else { // there wasn't anything encoded, return the original string |
455 |
return(mb_convert_encoding("kakikukeko", "EUC-JP", "auto")); |
return(mb_convert_encoding($value, "EUC-JP", "auto")); |
456 |
} |
} |
457 |
} |
} |
458 |
} |
} |
459 |
|
|
460 |
|
function decode_quoted_pair($value) { |
461 |
|
return(ereg_replace('\\\\(.)','\1',$value)); |
462 |
|
} |
463 |
|
|
464 |
function getTimestamp($value) { |
function getTimestamp($value) { |
465 |
$months=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12); |
$months=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12); |
466 |
$value=str_replace(" "," ",$value); |
$value=str_replace(" "," ",$value); |
559 |
case "x-newsreader:": |
case "x-newsreader:": |
560 |
case "x-mailer:": |
case "x-mailer:": |
561 |
case "user-agent:": |
case "user-agent:": |
562 |
$header->user_agent=trim($value); |
$header->user_agent=trim(headerDecode($value)); |
563 |
break; |
break; |
564 |
case "x-face:": |
case "x-face:": |
565 |
// echo "<p>-".base64_decode($value)."-</p>"; |
// echo "<p>-".base64_decode($value)."-</p>"; |
763 |
return false; |
return false; |
764 |
$rawmessage=array(); |
$rawmessage=array(); |
765 |
$line=lieszeile($ns); |
$line=lieszeile($ns); |
766 |
$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP"); |
#$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP"); |
767 |
while(strcmp($line,".") != 0) { |
while(strcmp($line,".") != 0) { |
768 |
$rawmessage[]=$line; |
$rawmessage[]=$line; |
769 |
$line=lieszeile($ns); |
$line=lieszeile($ns); |
770 |
$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP"); |
#$line=mb_convert_encoding($line, "EUC-JP", "ISO-2022-JP"); |
771 |
} |
} |
772 |
$message=parse_message($rawmessage); |
$message=parse_message($rawmessage); |
773 |
if (ereg('^[0-9]+$',$id)) $message->header->number=$id; |
if (ereg('^[0-9]+$',$id)) $message->header->number=$id; |