X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fdownload.php;h=60f388bb4d1b070edbdc638233780b1c795fa038;hb=83be314a29726be91884b222e4c136f9abade9de;hp=899aacaf919a2d293c892d257739539a2f077101;hpb=ff9d4297a3132d46982095ded7975c2bf8d6694b;p=squirrelmail.git diff --git a/src/download.php b/src/download.php index 899aacaf..60f388bb 100644 --- a/src/download.php +++ b/src/download.php @@ -146,15 +146,12 @@ if (isset($absolute_dl) && $absolute_dl == 'true') { * attachment in case of ERROR reporting = E_ALL and the output is the screen */ mime_print_body_lines ($imapConnection, $passed_id, $ent_id, $encoding); -$message = &$message->getEntity(''); -$messages[$mbx_response['UIDVALIDITY']]["$passed_id"] = &$message; - /* * This function is verified to work with Netscape and the *very latest* * version of IE. I don't know if it works with Opera, but it should now. */ function DumpHeaders($type0, $type1, $filename, $force) { - global $HTTP_USER_AGENT; + global $HTTP_USER_AGENT, $squirrelmail_language; $isIE = 0; if (strstr($HTTP_USER_AGENT, 'compatible; MSIE ') !== false && @@ -167,7 +164,16 @@ function DumpHeaders($type0, $type1, $filename, $force) { $isIE6 = 1; } + if ($squirrelmail_language == 'ja_JP') { + if (strstr($HTTP_USER_AGENT, 'Windows') !== false || + strstr($HTTP_USER_AGENT, 'Mac_') !== false) { + $filename = mb_convert_encoding($filename, 'SJIS', 'AUTO'); + } else { + $filename = mb_convert_encoding($filename, 'EUC-JP', 'AUTO'); + } + } else { $filename = ereg_replace('[^-a-zA-Z0-9\.]', '_', $filename); + } // A Pox on Microsoft and it's Office! if (! $force) {