Commit 467fb67b authored by YANO Takashi's avatar YANO Takashi

ZP-1172 Some mails bodies or headers in Japanese may be decoded in wrong...

ZP-1172 Some mails bodies or headers in Japanese may be decoded in wrong encoding. Released under the Affero GNU General Public License (AGPL) version 3.
parent 0c849336
......@@ -1077,6 +1077,10 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
if (Request::GetProtocolVersion() >= 12.0) {
$output->asbody = new SyncBaseBody();
if ( strpos($textBody, chr(0x1b).'$B') !== false ) {
$textBody = mb_convert_encoding($textBody, "utf-8", "ISO-2022-JP-MS");
}
$data = "";
switch($bpReturnType) {
case SYNC_BODYPREFERENCE_PLAIN:
......@@ -1106,10 +1110,6 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
break;
}
if ( strpos($data, chr(0x1b).'$B') !== false ) {
$data = mb_convert_encoding($data, "utf-8", "ISO-2022-JP-MS");
}
// truncate body, if requested.
// MIME should not be truncated, but encrypted messages are truncated always to the headers size
if ($bpReturnType == SYNC_BODYPREFERENCE_MIME) {
......
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