[Svn] r2352 - trunk/roundcubemail/program/include

trac at roundcube.net trac at roundcube.net
Wed Mar 11 22:43:20 CET 2009


Author: thomasb
Date: 2009-03-11 16:43:18 -0500 (Wed, 11 Mar 2009)
New Revision: 2352

Modified:
   trunk/roundcubemail/program/include/main.inc
Log:
Fix charset conversion error logging

Modified: trunk/roundcubemail/program/include/main.inc
===================================================================
--- trunk/roundcubemail/program/include/main.inc	2009-03-11 12:44:33 UTC (rev 2351)
+++ trunk/roundcubemail/program/include/main.inc	2009-03-11 21:43:18 UTC (rev 2352)
@@ -192,7 +192,7 @@
   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 @@
   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 @@
     $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 @@
       '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;

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list