summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-03-11 21:43:18 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2009-03-11 21:43:18 +0000
commit5448bdb6993c272f18b867b3b1162d8f66489fe2 (patch)
tree8dd56fe2e02d72a6b2ce1ab8c30dc6ebec7ba8d8 /roundcubemail/program
parent8013cb2424ca6912419dc7df73a9b8b77da7bdb0 (diff)
Fix charset conversion error logging
git-svn-id: https://svn.roundcube.net/trunk@2352 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/include/main.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 9adcd4cfc..b22be1aca 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/program/include/main.inc
@@ -192,7 +192,7 @@ function rcube_charset_convert($str, $from, $to=NULL)
if ($to == 'UNICODE-1-1-UTF-7')
$to = 'UTF-7';
- if ($from==$to || $str=='' || empty($from))
+ if ($from == $to || empty($str) || empty($from))
return $str;
$aliases = array(
@@ -246,6 +246,8 @@ function rcube_charset_convert($str, $from, $to=NULL)
if ($from == 'UTF-7') {
if ($_str = utf7_to_utf8($str))
$str = $_str;
+ else
+ $error = true;
}
else if (($from == 'ISO-8859-1') && function_exists('utf8_encode')) {
$str = utf8_encode($str);
@@ -254,7 +256,7 @@ function rcube_charset_convert($str, $from, $to=NULL)
$conv->loadCharset($from);
$str = $conv->strToUtf8($str);
}
- else if ($from != 'UTF-8') {}
+ else if ($from != 'UTF-8')
$error = true;
// encode string for output
@@ -278,7 +280,7 @@ function rcube_charset_convert($str, $from, $to=NULL)
'code' => 500,
'type' => 'php',
'file' => __FILE__,
- 'message' => "Could not convert string charset. Make sure iconv is installed or lib/utf8.class is available"
+ 'message' => "Could not convert string from $from to $to. Make sure iconv is installed or lib/utf8.class is available"
), true, false);
$convert_warning = true;