// Don't kill the connection if the browser is over a dialup
// and it would take over 30 seconds to download it.
- // don´t call set_time_limit in safe mode.
+ // don\8e´t call set_time_limit in safe mode.
if (!ini_get("safe_mode")) {
set_time_limit(0);
}
// If there are other types that shouldn't be formatted, add
// them here
if ($body_message->header->type1 == 'html') {
+ $body = charset_decode_japanese($body);
if ( $show_html_default <> 1 ) {
$body = strip_tags( $body );
translateText($body, $wrap_at,
/** this function decodes the body depending on the encoding type. **/
function decodeBody($body, $encoding) {
+
$body = str_replace("\r\n", "\n", $body);
$encoding = strtolower($encoding);
* Patched by Christian Schmidt <christian@ostenfeld.dk> 23/03/2002
*/
function decodeHeader ($string, $utfencode=true) {
+ global $squirrelmail_language;
if (is_array($string)) {
$string = implode("\n", $string);
}
+
+ if ($squirrelmail_language == 'ja_JP' && function_exists('mb_convert_encoding')) {
+ $string = str_replace("\t", "", $string);
+ if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $string))
+ $string = mb_decode_mimeheader($string);
+ return @mb_convert_encoding($string, 'EUC-JP', 'AUTO');
+ }
+
$i = 0;
while (preg_match('/^(.{' . $i . '})(.*)=\?([^?]*)\?(Q|B)\?([^?]*)\?=/Ui',
$string, $res)) {
* be encoded.
*/
function encodeHeader ($string) {
- global $default_charset;
+ global $default_charset, $squirrelmail_language;
+
+ if ($squirrelmail_language == 'ja_JP' && function_exists('mb_encode_mimeheader')) {
+ return mb_encode_mimeheader($string);
+ }
// Encode only if the string contains 8-bit characters or =?
$j = strlen( $string );
$cidurl = substr(trim($cidurl), 4);
$httpurl = $quotchar . "../src/download.php?absolute_dl=true&" .
"passed_id=$id&mailbox=" . urlencode($mailbox) .
- "&passed_ent_id=" . find_ent_id($cidurl, $message) . $quotchar;
+ "&ent_id=" . find_ent_id($cidurl, $message) . $quotchar;
return $httpurl;
}