diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/class/deliver/Deliver.class.php squirrelmail-1.4.3a-ja/class/deliver/Deliver.class.php --- squirrelmail-1.4.3a/class/deliver/Deliver.class.php 2004-05-05 06:57:28.000000000 +0900 +++ squirrelmail-1.4.3a-ja/class/deliver/Deliver.class.php 2004-08-25 14:16:03.000000000 +0900 @@ -381,7 +381,7 @@ $date = date('D, j M Y H:i:s ', mktime()) . $this->timezone(); /* Create a message-id */ $message_id = '<' . $REMOTE_PORT . '.' . $REMOTE_ADDR . '.'; - $message_id .= time() . '.squirrel@' . $REMOTE_ADDR .'>'; + $message_id .= time() . '.squirrel@' . $SERVER_NAME .'>'; /* Make an RFC822 Received: line */ if (isset($REMOTE_HOST)) { $received_from = "$REMOTE_HOST ([$REMOTE_ADDR])"; @@ -548,9 +548,11 @@ while (strlen($line) > $length) { $fold = false; /* handle encoded parts */ - if (preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)(\s+|.*)/Ui',$line,$regs)) { + if (preg_match('/(".*")(.*)/Ui', $line, $regs) || + preg_match('/(<.*>)(.*)/Ui', $line, $regs) || + preg_match('/(=\?([^?]*)\?(Q|B)\?([^?]*)\?=)(\s+|.*)/Ui',$line,$regs)) { $fold_tmp = $regs[1]; - if (!trim($regs[5])) { + if (isset($regs[5]) && !trim($regs[5])) { $fold_tmp .= $regs[5]; } $iPosEnc = strpos($line,$fold_tmp); @@ -602,6 +604,9 @@ default: break; } + if (substr($line_tmp, $iFoldPos, 2) == '=?') { + $iFoldPos--; + } if (!$iFoldPos) { /* clean folding didn't work */ $iFoldPos = $length; } diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/class/mime/Rfc822Header.class.php squirrelmail-1.4.3a-ja/class/mime/Rfc822Header.class.php --- squirrelmail-1.4.3a/class/mime/Rfc822Header.class.php 2004-02-29 00:00:49.000000000 +0900 +++ squirrelmail-1.4.3a-ja/class/mime/Rfc822Header.class.php 2004-05-31 08:29:47.000000000 +0900 @@ -39,10 +39,11 @@ in smtp.php */ function parseHeader($hdr) { if (is_array($hdr)) { + array_shift($hdr);array_pop($hdr); $hdr = implode('', $hdr); } - /* First we replace \r\n by \n and unfold the header */ - $hdr = trim(str_replace(array("\r\n", "\n\t", "\n "),array("\n", ' ', ' '), $hdr)); + /* First we unfold the header */ + $hdr = trim(preg_replace("/\r\n\s+/", '', $hdr)); /* Now we can make a new header array with */ /* each element representing a headerline */ diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/functions/date.php squirrelmail-1.4.3a-ja/functions/date.php --- squirrelmail-1.4.3a/functions/date.php 2004-05-05 09:34:14.000000000 +0900 +++ squirrelmail-1.4.3a-ja/functions/date.php 2004-06-03 09:28:28.000000000 +0900 @@ -348,8 +348,8 @@ if ($invert_time) { $dateZ = - $dateZ; } - $midnight = $now - ($now % 86400) - $dateZ; - $nextmid = $midnight + 86400 - $dateZ; + $midnight = $now - ($now + $dateZ) % 86400; + $nextmid = $midnight + 86400; if (($show_full_date == 1) || ($nextmid < $stamp)) { $date_format = _("M j, Y"); diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/functions/i18n.php squirrelmail-1.4.3a-ja/functions/i18n.php --- squirrelmail-1.4.3a/functions/i18n.php 2004-05-20 00:57:23.000000000 +0900 +++ squirrelmail-1.4.3a-ja/functions/i18n.php 2004-10-13 13:04:15.000000000 +0900 @@ -21,17 +21,18 @@ function charset_decode ($charset, $string) { global $languages, $squirrelmail_language; - if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && - function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) { - $string = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $string); + $charset = strtolower($charset); + + if ($charset == 'iso-2022-jp' || $charset == 'shift_jis' || $charset == 'euc-jp' || + ($charset == '' && $squirrelmail_language == 'ja_JP') || + ($charset == 'utf-8' && $squirrelmail_language == 'ja_JP')) { + $string = $languages['ja_JP']['XTRA_CODE']('decode', $string); } /* All HTML special characters are 7 bit and can be replaced first */ $string = htmlspecialchars ($string); - $charset = strtolower($charset); - set_my_charset() ; /* controls cpu and memory intensive decoding cycles */ @@ -86,6 +87,13 @@ } else { $ret = charset_decode_iso_8859_default ($string); } + } else if ($charset == 'iso-2022-jp') { + if ($squirrelmail_language != 'ja_JP') { + include_once(SM_PATH . 'functions/decode/utf-8.php'); + $ret = charset_decode_utf8 (@mb_convert_encoding($string, 'UTF-8', 'AUTO')); + } else { + $ret = $string; + } } else if ($charset == 'ns_4551-1') { $ret = charset_decode_ns_4551_1 ($string); } else if ($charset == 'koi8-r') { @@ -593,23 +601,25 @@ if (function_exists('mb_detect_encoding')) { switch (func_get_arg(0)) { /* action */ case 'decode': - $detect_encoding = @mb_detect_encoding($ret); - if ($detect_encoding == 'JIS' || - $detect_encoding == 'EUC-JP' || - $detect_encoding == 'SJIS' || - $detect_encoding == 'UTF-8') { + if (strpos($ret, chr(27)) !== FALSE) { + $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', 'JIS'), "KV"); + } else { + $detect_encoding = strtolower(@mb_detect_encoding($ret)); + if ($detect_encoding == 'jis' || + $detect_encoding == 'sjis' || + $detect_encoding == 'utf-8') { - $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', 'AUTO'), "KV"); + $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', $detect_encoding), "KV"); + } } break; case 'encode': - $detect_encoding = @mb_detect_encoding($ret); - if ($detect_encoding == 'JIS' || - $detect_encoding == 'EUC-JP' || - $detect_encoding == 'SJIS' || - $detect_encoding == 'UTF-8') { + $detect_encoding = strtolower(@mb_detect_encoding($ret)); + if ($detect_encoding == 'euc-jp' || + $detect_encoding == 'sjis' || + $detect_encoding == 'utf-8') { - $ret = mb_convert_encoding(mb_convert_kana($ret, "KV"), 'JIS', 'AUTO'); + $ret = mb_convert_encoding(mb_convert_kana($ret, "KV"), 'JIS', $detect_encoding); } break; case 'strimwidth': @@ -618,6 +628,7 @@ break; case 'encodeheader': $result = ''; + $ret = mb_convert_kana($ret, "KV"); if (strlen($ret) > 0) { $tmpstr = mb_substr($ret, 0, 1); $prevcsize = strlen($tmpstr); @@ -647,18 +658,19 @@ $ret = $result; break; case 'decodeheader': - $ret = str_replace("\t", "", $ret); - if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $ret)) + if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $ret)) { $ret = @mb_decode_mimeheader($ret); - $ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO'); + } elseif (strpos($ret, chr(27)) !== FALSE) { + $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', 'JIS'), "KV"); + } break; case 'downloadfilename': $useragent = func_get_arg(2); if (strstr($useragent, 'Windows') !== false || strstr($useragent, 'Mac_') !== false) { - $ret = mb_convert_encoding($ret, 'SJIS', 'AUTO'); + $ret = @mb_convert_encoding($ret, 'SJIS', 'AUTO'); } else { - $ret = mb_convert_encoding($ret, 'EUC-JP', 'AUTO'); + $ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO'); } break; case 'wordwrap': diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/functions/imap_messages.php squirrelmail-1.4.3a-ja/functions/imap_messages.php --- squirrelmail-1.4.3a/functions/imap_messages.php 2004-04-21 01:55:41.000000000 +0900 +++ squirrelmail-1.4.3a-ja/functions/imap_messages.php 2004-08-25 14:16:03.000000000 +0900 @@ -614,8 +614,8 @@ $i = strpos($read,'{',$i); $header = parseString($read,$i); if ($header === false) break 2; - /* First we replace all \r\n by \n, and unfold the header */ - $hdr = trim(str_replace(array("\r\n", "\n\t", "\n "),array("\n", ' ', ' '), $header)); + /* First we unfold the header */ + $hdr = trim(preg_replace("/\r\n\s+/", '',$header)); /* Now we can make a new header array with */ /* each element representing a headerline */ $hdr = explode("\n" , $hdr); @@ -729,7 +729,7 @@ foreach ($readin_list as $r) { $r = implode('',$r); /* first we unfold the header */ - $r = str_replace(array("\r\n", "\n\t","\n\s"),array("\n",'',''),$r); + $r = trim(preg_replace("/\r\n\s+/",'',$r)); /* * now we can make a new header array with each element representing * a headerline diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/functions/imap_search.php squirrelmail-1.4.3a-ja/functions/imap_search.php --- squirrelmail-1.4.3a/functions/imap_search.php 2004-02-25 00:57:26.000000000 +0900 +++ squirrelmail-1.4.3a-ja/functions/imap_search.php 2004-05-31 08:29:47.000000000 +0900 @@ -45,7 +45,7 @@ if ($imap_server_type == 'macosx') { foreach ($multi_search as $multi_search_part) { if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') { - $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto'); + $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'EUC-JP'); } $search_string .= $search_where . ' ' .$multi_search_part . ' '; } @@ -53,7 +53,7 @@ else { foreach ($multi_search as $multi_search_part) { if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') { - $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto'); + $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'EUC-JP'); } $search_string .= $search_where . ' {' . strlen($multi_search_part) . "}\r\n" . $multi_search_part . ' '; diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/functions/mime.php squirrelmail-1.4.3a-ja/functions/mime.php --- squirrelmail-1.4.3a/functions/mime.php 2004-05-24 01:14:11.000000000 +0900 +++ squirrelmail-1.4.3a-ja/functions/mime.php 2004-10-14 07:49:55.000000000 +0900 @@ -160,7 +160,7 @@ /* 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Ž´t call set_time_limit in safe mode. */ if (!ini_get('safe_mode')) { @@ -265,9 +265,16 @@ function translateText(&$body, $wrap_at, $charset) { global $where, $what; /* from searching */ global $color; /* color theme */ + global $languages, $squirrelmail_language; require_once(SM_PATH . 'functions/url_parser.php'); + if ($charset == 'iso-2022-jp' || $charset == 'shift_jis' || $charset == 'euc-jp' || + ($squirrelmail_language == 'ja_JP' && $charset == 'utf-8') || + ($squirrelmail_language == 'ja_JP' && $charset == '')) { + $body = $languages['ja_JP']['XTRA_CODE']('decode', $body); + } + $body_ary = explode("\n", $body); for ($i=0; $i < count($body_ary); $i++) { $line = $body_ary[$i]; @@ -275,6 +282,7 @@ sqWordWrap($line, $wrap_at); } $line = charset_decode($charset, $line); + $line = str_replace("\t", ' ', $line); parseUrl ($line); @@ -337,7 +345,8 @@ $body = mime_fetch_body ($imap_stream, $id, $ent_num); $body = decodeBody($body, $body_message->header->encoding); - if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && + if (strtolower($body_message->header->getParameter('charset')) == 'iso-2022-jp' && + isset($languages[$squirrelmail_language]['XTRA_CODE']) && function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) { if (mb_detect_encoding($body) != 'ASCII') { $body = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $body); @@ -529,7 +538,7 @@ /* This function decodes the body depending on the encoding type. */ function decodeBody($body, $encoding) { - global $show_html_default; + global $show_html_default, $squirrelmail_language; $body = str_replace("\r\n", "\n", $body); $encoding = strtolower($encoding); @@ -546,9 +555,11 @@ $encoding == 'quoted_printable') { $body = quoted_printable_decode($body); + if ($squirrelmail_language != 'ja_JP') { while (ereg("=\n", $body)) { $body = ereg_replace ("=\n", '', $body); } + } } else if ($encoding == 'base64') { $body = base64_decode($body); @@ -574,6 +585,11 @@ $string = $languages[$squirrelmail_language]['XTRA_CODE']('decodeheader', $string); // Do we need to return at this point? // return $string; + if ($htmlsave) { + return htmlspecialchars($string); + } else { + return $string; + } } $i = 0; $iLastMatch = -2; @@ -1328,6 +1344,12 @@ sq_unspace($attvalue); /** + * Remove \r \n \t \0 " " "\\" + */ + $attvalue = str_replace(Array("\r", "\n", "\t", "\0", " ", "\\"), + Array('', '','','','',''), $attvalue); + + /** * Now let's run checks on the attvalues. * I don't expect anyone to comprehend this. If you do, * get in touch with me so I can drive to where you live and diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/functions/url_parser.php squirrelmail-1.4.3a-ja/functions/url_parser.php --- squirrelmail-1.4.3a/functions/url_parser.php 2004-02-25 00:57:26.000000000 +0900 +++ squirrelmail-1.4.3a-ja/functions/url_parser.php 2004-05-31 08:29:48.000000000 +0900 @@ -72,6 +72,8 @@ '. ', ' ', ')', '(', '"', '<', '>', '.<', ']', '[', '{', '}', "\240", ', ', '. ', ",\n", ",\r"); +for ($chr = 0xa1; $chr <= 0xfe; $chr++) // EUC-JP 1st byte + $url_parser_poss_ends[] = chr($chr); function parseUrl (&$body) { global $url_parser_poss_ends, $url_parser_url_tokens;; ¥Ð¥¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ësquirrelmail-1.4.3a/locale/ja_JP/LC_MESSAGES/squirrelmail.mo¤Èsquirrelmail-1.4.3a-ja/locale/ja_JP/LC_MESSAGES/squirrelmail.mo¤Ï°ã¤¤¤Þ¤¹ diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/locale/ja_JP/LC_MESSAGES/squirrelmail.po squirrelmail-1.4.3a-ja/locale/ja_JP/LC_MESSAGES/squirrelmail.po --- squirrelmail-1.4.3a/locale/ja_JP/LC_MESSAGES/squirrelmail.po 2004-04-29 03:07:16.000000000 +0900 +++ squirrelmail-1.4.3a-ja/locale/ja_JP/LC_MESSAGES/squirrelmail.po 2004-08-21 00:51:32.000000000 +0900 @@ -7,7 +7,7 @@ "Project-Id-Version: squirrelmail 1.4.3cvs\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2004-04-21 09:34+0300\n" -"PO-Revision-Date: 2004-04-27 22:58+0900\n" +"PO-Revision-Date: 2004-08-19 11:43+0900\n" "Last-Translator: Masato HIGASHIYAMA \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" @@ -149,7 +149,7 @@ msgstr "¥É¥é¥Õ¥È¤ËÊݸ¤·¤Þ¤·¤¿" msgid "Could not move/copy file. File not attached" -msgstr "źÉÕ¤¹¤ë¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤ê¤Þ¤»¤ó" +msgstr "¥Õ¥¡¥¤¥ë¤Î°ÜÆ°¤Þ¤¿¤Ï¥³¥Ô¡¼¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£¥Õ¥¡¥¤¥ë¤ÏźÉÕ¤µ¤ì¤Þ¤»¤ó¤Ç¤·¤¿¡£" msgid "Draft Saved" msgstr "¥É¥é¥Õ¥È¤ËÊݸ¤·¤Þ¤·¤¿" @@ -903,40 +903,40 @@ msgstr "ÅÚ" msgid "January" -msgstr " 1·î" +msgstr " 1" msgid "February" -msgstr " 2·î" +msgstr " 2" msgid "March" -msgstr " 3·î" +msgstr " 3" msgid "April" -msgstr " 4·î" +msgstr " 4" msgid "May" -msgstr " 5·î" +msgstr " 5" msgid "June" -msgstr " 6·î" +msgstr " 6" msgid "July" -msgstr " 7·î" +msgstr " 7" msgid "August" -msgstr " 8·î" +msgstr " 8" msgid "September" -msgstr " 9·î" +msgstr " 9" msgid "October" -msgstr "10·î" +msgstr "10" msgid "November" -msgstr "11·î" +msgstr "11" msgid "December" -msgstr "12·î" +msgstr "12" msgid "Jan" msgstr " 1" @@ -981,7 +981,7 @@ msgstr "Yǯ F·î jÆü (D) G:i" msgid "M j, Y" -msgstr "Y/m/j" +msgstr "Y/m/d" msgid "g:i a" msgstr "" @@ -1341,7 +1341,7 @@ msgstr "Í׵ᤵ¤ì¤¿Æ°ºî¤Ï¼Â¹Ô¤Ç¤­¤Þ¤»¤ó:¥á¡¼¥ë¥Ü¥Ã¥¯¥¹¤¬ÍøÍѤǤ­¤Þ¤»¤ó" msgid "Transaction failed" -msgstr "ËÝÌõ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿" +msgstr "½èÍý¤Ë¼ºÇÔ¤·¤Þ¤·¤¿" msgid "Unknown response" msgstr "ÉÔÌÀ¤Ê±þÅú" @@ -1434,7 +1434,7 @@ msgstr "žÁ÷¤¹¤ë¤È¤­¤ËCC¤Î°¸Àè¤â´Þ¤á¤ë" msgid "Include Me in CC when I Reply All" -msgstr "ÊÖ¿®¤¹¤ë¤È¤­ CC ¤Ë¼«Ê¬¤â´Þ¤á¤ë" +msgstr "Á´°÷¤ËÊÖ¿®¤¹¤ë¤È¤­ CC ¤Ë¼«Ê¬¤â´Þ¤á¤ë" msgid "Enable Mailer Display" msgstr "¥á¡¼¥é¤òɽ¼¨" @@ -2844,11 +2844,7 @@ "only works in IE but you won't see errors with other browsers). This will " "always tell you if you have new mail, even if you have Check RECENT " "enabled." -msgstr "" -"¥¿¥¤¥È¥ë¤ÎÊѹ¹¤òÀßÄꤹ¤ë¤È¡¢¥Ö¥é¥¦¥¶¤Î¥¿¥¤¥È¥ë¤Ë¿·Ãå¥á¡¼¥ë¤¬¤¢¤ë¤³¤È¤ò" -"ɽ¼¨¤·¤Þ¤¹¡£JavaScript¤¬Æ°ºî¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£IE¤Ç¤·¤«Æ°ºî¤·¤Ê¤¤¤Ç¤·¤ç¤¦¡£" -"¾¤Î¥Ö¥é¥¦¥¶¤Ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤³¤ì¤Ï¡¢¤¢¤Ê¤¿¤¬¡Ö¥Á¥§¥Ã¥¯" -"RECENT¡×¤òÍ­¸ú¤Ë¤Æ¤¤¤Æ¤â¡¢¿·Ãå¥á¡¼¥ë¤¬¤¢¤ë¤«¤É¤¦¤«ÃΤ餻¤Æ¤¯¤ì¤Þ¤¹¡£" +msgstr "¥¿¥¤¥È¥ë¤ÎÊѹ¹¤òÀßÄꤹ¤ë¤È¡¢¥Ö¥é¥¦¥¶¤Î¥¿¥¤¥È¥ë¤Ë¿·Ãå¥á¡¼¥ë¤¬¤¢¤ë¤³¤È¤òɽ¼¨¤·¤Þ¤¹¡£JavaScript¤¬Æ°ºî¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£IE¤Ç¤·¤«Æ°ºî¤·¤Ê¤¤¤Ç¤·¤ç¤¦¡£Â¾¤Î¥Ö¥é¥¦¥¶¤Ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤³¤ì¤Ï¡¢¤¢¤Ê¤¿¤¬¡Ö¥Á¥§¥Ã¥¯RECENT¡×¤òÍ­¸ú¤Ë¤·¤Æ¤¤¤Æ¤â¡¢¿·Ãå¥á¡¼¥ë¤¬¤¢¤ë¤«¤É¤¦¤«ÃΤ餻¤Æ¤¯¤ì¤Þ¤¹¡£" msgid "" "Select from the list of server files the media file to play when new " diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/calendar/calendar.php squirrelmail-1.4.3a-ja/plugins/calendar/calendar.php --- squirrelmail-1.4.3a/plugins/calendar/calendar.php 2004-02-25 00:57:29.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/calendar/calendar.php 2004-05-31 08:29:48.000000000 +0900 @@ -116,8 +116,8 @@ $i=0; while ($calfoo = each($calendardata[$cdate])) { $calbar = $calendardata[$cdate][$calfoo['key']]; - $title = '['. $calfoo['key']. '] ' .$calbar['message']; - echo ($calbar['priority']==1) ? "$calbar[title]
\n" : "$calbar[title]
\n"; + $title = '['. $calfoo['key']. '] ' . str_replace('<br />', "\n", $calbar['message']); + echo ($calbar['priority']==1) ? "".$calbar['title']."
\n" : "".$calbar['title']."
\n"; $i=$i+1; if($i==2){ break; diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/calendar/day.php squirrelmail-1.4.3a-ja/plugins/calendar/day.php --- squirrelmail-1.4.3a/plugins/calendar/day.php 2004-02-25 00:57:29.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/calendar/day.php 2004-05-31 08:29:48.000000000 +0900 @@ -130,7 +130,7 @@ html_tag( 'td', $ehour . ':' . $eminute . $elength, 'left' ) . html_tag( 'td', '', 'left' ) . '['; echo ($calbar['priority']==1) ? "$calbar[title]" : "$calbar[title]"; - echo"] $calbar[message] " . + echo"]
" . str_replace('<br />', '
', $calbar['message']) . " " . html_tag( 'td', "\n" . "". diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/calendar/event_delete.php squirrelmail-1.4.3a-ja/plugins/calendar/event_delete.php --- squirrelmail-1.4.3a/plugins/calendar/event_delete.php 2004-02-25 00:57:29.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/calendar/event_delete.php 2004-05-31 08:29:48.000000000 +0900 @@ -104,7 +104,8 @@ ) . html_tag( 'tr', html_tag( 'td', _("Message:"), 'right', $color[4] ) . - html_tag( 'td', $tmparray['message'], 'left', $color[4] ) + html_tag( 'td', str_replace('<br />', '
', $tmparray['message']) + , 'left', $color[4] ) ) . html_tag( 'tr', html_tag( 'td', diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/calendar/event_edit.php squirrelmail-1.4.3a-ja/plugins/calendar/event_edit.php --- squirrelmail-1.4.3a/plugins/calendar/event_edit.php 2004-02-25 00:57:29.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/calendar/event_edit.php 2004-05-31 08:29:48.000000000 +0900 @@ -156,7 +156,8 @@ "
\n". " \n". html_tag( 'td', - " \n" , + " \n" , 'left', $color[4], 'colspan="2"' ) . '' . html_tag( 'tr' ) . html_tag( 'td', @@ -194,7 +195,8 @@ ) . html_tag( 'tr', html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" . - html_tag( 'td', $tmparray['message'] , 'left', $color[4] ) ."\n" + html_tag( 'td', str_replace('<br />', '
', $tmparray['message']) + , 'left', $color[4] ) ."\n" ) . html_tag( 'tr', html_tag( 'th', _("to:") . "
\n", '', $color[4], 'colspan="2"' ) ."\n" @@ -218,7 +220,8 @@ ) . html_tag( 'tr', html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" . - html_tag( 'td', $event_text , 'left', $color[4] ) ."\n" + html_tag( 'td', str_replace('<br />', '
', $event_text) + , 'left', $color[4] ) ."\n" ) . html_tag( 'tr', html_tag( 'td', diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/delete_move_next/setup.php squirrelmail-1.4.3a-ja/plugins/delete_move_next/setup.php --- squirrelmail-1.4.3a/plugins/delete_move_next/setup.php 2004-04-25 21:52:38.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/delete_move_next/setup.php 2004-05-31 08:29:48.000000000 +0900 @@ -71,6 +71,7 @@ function delete_move_del_arr_elem($arr, $index) { $tmp = array(); + if (count($arr)) { $j = 0; foreach ($arr as $v) { if ($j != $index) { @@ -78,6 +79,7 @@ } $j++; } + } return $tmp; } diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/filters/filters.php squirrelmail-1.4.3a-ja/plugins/filters/filters.php --- squirrelmail-1.4.3a/plugins/filters/filters.php 2004-02-25 00:57:30.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/filters/filters.php 2004-05-31 08:29:48.000000000 +0900 @@ -262,6 +262,10 @@ $what = addslashes(trim($what[1])); } + if ($squirrelmail_language == 'ja_JP') { + $what = mb_convert_encoding($what, 'JIS', 'EUC-JP'); + } + if ($imap_server_type == 'macosx') { $search_str .= ' ' . $where . ' ' . $what; } else { @@ -462,7 +466,7 @@ $filters = array(); for ($i=0; $fltr = getPref($data_dir, $username, 'filter' . $i); $i++) { - $ary = explode(',', $fltr); + $ary = explode(',', $fltr, 3); $filters[$i]['where'] = $ary[0]; $filters[$i]['what'] = $ary[1]; $filters[$i]['folder'] = $ary[2]; diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/plugins/filters/options.php squirrelmail-1.4.3a-ja/plugins/filters/options.php --- squirrelmail-1.4.3a/plugins/filters/options.php 2004-04-27 07:20:06.000000000 +0900 +++ squirrelmail-1.4.3a-ja/plugins/filters/options.php 2004-05-31 08:29:48.000000000 +0900 @@ -228,7 +228,7 @@ echo ']'. html_tag( 'td', '-', 'left' ) . html_tag( 'td', '', 'left' ); - printf( _("If %s contains %s then move to %s"), $filters[$i]['where'], $filters[$i]['what'], $fdr ); + printf( _("If %s contains %s then move to %s"), _($filters[$i]['where']), $filters[$i]['what'], imap_utf7_decode_local($fdr) ); echo ''; } diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/src/compose.php squirrelmail-1.4.3a-ja/src/compose.php --- squirrelmail-1.4.3a/src/compose.php 2004-06-01 02:32:34.000000000 +0900 +++ squirrelmail-1.4.3a-ja/src/compose.php 2004-10-14 07:49:55.000000000 +0900 @@ -323,7 +323,7 @@ exit(); } else { - Header("Location: $location/right_main.php?mailbox=$draft_folder&sort=$sort". + Header("Location: $location/right_main.php?mailbox=" . urlencode($draft_folder) . "&sort=$sort". "&startMessage=1¬e=".urlencode($draft_message)); exit(); } @@ -616,6 +616,12 @@ $body_part_entity = $message->getEntity($ent); $bodypart = decodeBody($unencoded_bodypart, $body_part_entity->header->encoding); + if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && + function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) { + if (mb_detect_encoding($bodypart) != 'ASCII') { + $bodypart = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $bodypart); + } + } if ($type1 == 'html') { $bodypart = str_replace("\n", ' ', $bodypart); $bodypart = preg_replace(array('/

/i','//i'), "\n", $bodypart); @@ -623,12 +629,6 @@ $bodypart = strip_tags($bodypart); } - if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && - function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) { - if (mb_detect_encoding($bodypart) != 'ASCII') { - $bodypart = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $bodypart); - } - } $body .= $bodypart; } if ($default_use_priority) { @@ -1428,12 +1428,17 @@ $mime_header->type1 = 'plain'; if ($special_encoding) { $mime_header->encoding = $special_encoding; + if ($special_encoding == '8bit') { + $mime_header->parameters['charset'] = 'us-ascii'; } else { - $mime_header->encoding = '8bit'; + $mime_header->parameters['charset']=$default_charset; } + } else { + $mime_header->encoding = '8bit'; if ($default_charset) { $mime_header->parameters['charset'] = $default_charset; } + } $message_body->mime_header = $mime_header; array_unshift($composeMessage->entities, $message_body); $content_type = new ContentType('multipart/mixed'); @@ -1441,13 +1446,18 @@ $content_type = new ContentType('text/plain'); if ($special_encoding) { $rfc822_header->encoding = $special_encoding; + if ($special_encoding == '8bit') { + $content_type->properties['charset'] = 'us-ascii'; } else { - $rfc822_header->encoding = '8bit'; + $content_type->properties['charset']=$default_charset; } + } else { + $rfc822_header->encoding = '8bit'; if ($default_charset) { $content_type->properties['charset']=$default_charset; } } + } $rfc822_header->content_type = $content_type; $composeMessage->rfc822_header = $rfc822_header; diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/src/printer_friendly_bottom.php squirrelmail-1.4.3a-ja/src/printer_friendly_bottom.php --- squirrelmail-1.4.3a/src/printer_friendly_bottom.php 2004-02-25 00:57:39.000000000 +0900 +++ squirrelmail-1.4.3a-ja/src/printer_friendly_bottom.php 2004-05-31 08:29:48.000000000 +0900 @@ -80,6 +80,8 @@ $body = _("Message not printable"); } +if ($squirrelmail_language != 'ja_JP') { + /* now, if they choose to, we clean up the display a bit... */ if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) { @@ -101,6 +103,7 @@ $date = pf_clean_string($date, $num_leading_spaces); } // end cleanup +} $to = decodeHeader($to); $cc = decodeHeader($cc); diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/src/read_body.php squirrelmail-1.4.3a-ja/src/read_body.php --- squirrelmail-1.4.3a/src/read_body.php 2004-04-27 08:48:38.000000000 +0900 +++ squirrelmail-1.4.3a-ja/src/read_body.php 2004-05-31 08:29:48.000000000 +0900 @@ -169,6 +169,14 @@ // FIX ME, use identity.php from SM 1.5. Change this also in compose.php + if (ereg("^([^@%/]+)[@%/](.+)$", $username, $usernamedata)) { + $popuser = $usernamedata[1]; + $domain = $usernamedata[2]; + unset($usernamedata); + } else { + $popuser = $username; + } + $reply_to = ''; if (isset($identity) && $identity != 'default') { $from_mail = getPref($data_dir, $username, diff -uNrw -x CVS -x .cvsignore squirrelmail-1.4.3a/src/search.php squirrelmail-1.4.3a-ja/src/search.php --- squirrelmail-1.4.3a/src/search.php 2004-03-07 06:02:50.000000000 +0900 +++ squirrelmail-1.4.3a-ja/src/search.php 2004-05-31 08:29:48.000000000 +0900 @@ -151,7 +151,7 @@ $types = array('saved_what', 'saved_where', 'saved_folder'); $attributes = get_saved($username, $data_dir); foreach ($types as $key) { - array_splice($attributes[$key], $delete_index, 1); + array_splice($attributes[$key], $delete_index - 1, 1); } reset($types); $n=0; @@ -303,7 +303,7 @@ . html_tag( 'tr' ) . html_tag( 'td' ) . html_tag( 'table', '', 'center', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"' ); - for ($i=0; $i < $saved_count; ++$i) { + for ($i=1; $i <= $saved_count; ++$i) { if ($i % 2) { echo html_tag( 'tr', '', '', $color[0] ); } else {