summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-04-08 06:18:11 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-04-08 06:18:11 +0000
commita79cd8a21e109a21bb6fe117db0c9f5a8e41e419 (patch)
tree60cba1f7cd777df05f06462e73ef262f824999ad /roundcubemail/program/include
parent0e1a2f29a974462d4bd8a569f5c1161e1041812b (diff)
- Fix bug where default_charset was not used for text messages (#1487836)
git-svn-id: https://svn.roundcube.net/trunk@4633 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_imap.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_imap.php b/roundcubemail/program/include/rcube_imap.php
index b998c224e..79acdeed9 100644
--- a/roundcubemail/program/include/rcube_imap.php
+++ b/roundcubemail/program/include/rcube_imap.php
@@ -2426,9 +2426,11 @@ class rcube_imap
* @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 @@ class rcube_imap
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);
}