[Svn] r4633 - in trunk/roundcubemail: . program/include

trac at roundcube.net trac at roundcube.net
Fri Apr 8 08:18:11 CEST 2011


Author: alec
Date: 2011-04-08 01:18:11 -0500 (Fri, 08 Apr 2011)
New Revision: 4633

Modified:
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/program/include/rcube_imap.php
Log:
- Fix bug where default_charset was not used for text messages (#1487836)


Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2011-04-08 06:15:37 UTC (rev 4632)
+++ trunk/roundcubemail/CHANGELOG	2011-04-08 06:18:11 UTC (rev 4633)
@@ -1,6 +1,7 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Fix bug where default_charset was not used for text messages (#1487836)
 - Enable TinyMCE's contextmenu (#1487014)
 - TinyMCE 3.4.1
 - Stateless request tokens. No keep-alive necessary on login page (#1487829)

Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2011-04-08 06:15:37 UTC (rev 4632)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2011-04-08 06:18:11 UTC (rev 4633)
@@ -2426,9 +2426,11 @@
      * @param  rcube_message_part $o_part Part object created by get_structure()
      * @param  mixed              $print  True to print part, ressource to write part contents in
      * @param  resource           $fp     File pointer to save the message part
+     * @param  boolean            $skip_charset_conv Disables charset conversion
+     *
      * @return string Message/part body if not printed
      */
-    function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL)
+    function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL, $skip_charset_conv=false)
     {
         // get part encoding if not provided
         if (!is_object($o_part)) {
@@ -2458,10 +2460,13 @@
             return true;
         }
 
-        // convert charset (if text or message part) and part's charset is specified
-        if ($body && $o_part->charset
-            && preg_match('/^(text|message)$/', $o_part->ctype_primary)
+        // convert charset (if text or message part)
+        if ($body && !$skip_charset_conv &&
+            preg_match('/^(text|message)$/', $o_part->ctype_primary)
         ) {
+            if (!$o_part->charset || strtoupper($o_part->charset) == 'US-ASCII') {
+                $o_part->charset = $this->default_charset;
+            }
             $body = rcube_charset_convert($body, $o_part->charset);
         }
 

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



More information about the Svn mailing list