Commit 2a4e9dd0 authored by YANO Takashi's avatar YANO Takashi

ZP-869 utf-7 charset conversion: some folders are not shown.Released under the...

ZP-869 utf-7 charset conversion: some folders are not shown.Released under the Affero GNU General Public License (AGPL) version 3.
parent 845ffe17
...@@ -201,7 +201,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider { ...@@ -201,7 +201,7 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
} }
unset($Mail_RFC822); unset($Mail_RFC822);
if (isset($message->headers["subject"]) and mb_detect_encoding($message->headers["subject"], "UTF-8") != FALSE and preg_match('/[^\x00-\x7F]/', $message->headers["subject"]) == 1) { if (isset($message->headers["subject"]) && mb_detect_encoding($message->headers["subject"], "UTF-8") != false && preg_match('/[^\x00-\x7F]/', $message->headers["subject"]) == 1) {
mb_internal_encoding("UTF-8"); mb_internal_encoding("UTF-8");
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->SendMail(): Subject in raw UTF-8: %s", $message->headers["subject"])); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->SendMail(): Subject in raw UTF-8: %s", $message->headers["subject"]));
$message->headers["subject"] = mb_encode_mimeheader($message->headers["subject"]); $message->headers["subject"] = mb_encode_mimeheader($message->headers["subject"]);
......
...@@ -521,8 +521,6 @@ class Utils { ...@@ -521,8 +521,6 @@ class Utils {
static public function Utf7imap_to_utf8($string) { static public function Utf7imap_to_utf8($string) {
if (function_exists("mb_convert_encoding")){ if (function_exists("mb_convert_encoding")){
return @mb_convert_encoding($string, "UTF-8", "UTF7-IMAP"); return @mb_convert_encoding($string, "UTF-8", "UTF7-IMAP");
} else {
ZLog::Write(LOGLEVEL_WARN, "Utils::Utf7imap_to_utf8() 'mb_convert_encoding' is not available. Charset conversion skipped.");
} }
return $string; return $string;
} }
...@@ -556,8 +554,6 @@ class Utils { ...@@ -556,8 +554,6 @@ class Utils {
static public function Utf8_to_utf7imap($string) { static public function Utf8_to_utf7imap($string) {
if (function_exists("mb_convert_encoding")){ if (function_exists("mb_convert_encoding")){
return @mb_convert_encoding($string, "UTF7-IMAP", "UTF-8"); return @mb_convert_encoding($string, "UTF7-IMAP", "UTF-8");
} else {
ZLog::Write(LOGLEVEL_WARN, "Utils::Utf7imap_to_utf8() 'mb_convert_encoding' is not available. Charset conversion skipped.");
} }
return $string; return $string;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment