diff options
author | till <till@php.net> | 2008-05-26 10:11:19 +0000 |
---|---|---|
committer | till <till@php.net> | 2008-05-26 10:11:19 +0000 |
commit | 3bfab3b99c5098e802b10a1d442c330af3524249 (patch) | |
tree | ed28ce2224d1565b68f627145647b89c3cb8c994 /program | |
parent | 027af30c7ce6d02a12beb9834ef408f1fe8f40ac (diff) |
fix to #1485083
Diffstat (limited to 'program')
-rw-r--r-- | program/include/main.inc | 6 | ||||
-rw-r--r-- | program/lib/imap.inc | 29 |
2 files changed, 23 insertions, 12 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 596079124..a9c8ccbfb 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -279,7 +279,11 @@ function rcube_charset_convert($str, $from, $to=NULL) if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') { $aliases['GB2312'] = 'GB18030'; - return iconv(($aliases[$from] ? $aliases[$from] : $from), ($aliases[$to] ? $aliases[$to] : $to) . "//IGNORE", $str); + $_iconv = iconv(($aliases[$from] ? $aliases[$from] : $from), ($aliases[$to] ? $aliases[$to] : $to) . "//IGNORE", $str); + if ($_iconv !== false) + { + return $_iconv; + } } // settings for mbstring module (by Tadashi Jokagi) diff --git a/program/lib/imap.inc b/program/lib/imap.inc index e97f81844..8ea4fbd12 100644 --- a/program/lib/imap.inc +++ b/program/lib/imap.inc @@ -1907,7 +1907,9 @@ function iil_C_ModFlag(&$conn, $mailbox, $messages, $flag, $mod) { if (iil_C_Select($conn, $mailbox)) { $c = 0; - fputs($fp, "flg STORE $messages " . $mod . "FLAGS (" . $flag . ")\r\n"); + $_line = "flg STORE $messages " . $mod . "FLAGS (" . $flag . ")\r\n"; + trigger_error($_line, E_USER_WARNING); + fputs($fp, $_line); do { $line=chop(iil_ReadLine($fp, 100)); if ($line[0] == '*') { @@ -2046,16 +2048,21 @@ function iil_C_Search(&$conn, $folder, $criteria) { } function iil_C_Move(&$conn, $messages, $from, $to) { - $fp = $conn->fp; - - if (!$from || !$to) { - return -1; - } - - $r = iil_C_Copy($conn, $messages, $from,$to); - if ($r==0) { - return iil_C_Delete($conn, $from, $messages); - } + global $CONFIG; + + $fp = $conn->fp; + + if (!$from || !$to) { + return -1; + } + $r = iil_C_Copy($conn, $messages, $from,$to); + if ($r==0) { + return iil_C_Delete($conn, $from, $messages); + } + // Copy failed + if (isset($CONFIG['delete_always']) && $CONFIG['delete_always'] === true) { + return iil_C_Delete($conn, $from, $messages); + } return $r; } |