summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
Diffstat (limited to 'program')
-rw-r--r--program/lib/Roundcube/rcube_imap.php2
-rw-r--r--program/steps/mail/compose.inc4
2 files changed, 3 insertions, 3 deletions
diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php
index dc5305808..f1363caf7 100644
--- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -2121,7 +2121,7 @@ class rcube_imap extends rcube_storage
// convert charset (if text or message part)
if ($body && preg_match('/^(text|message)$/', $o_part->ctype_primary)) {
// Remove NULL characters if any (#1486189)
- if (strpos($body, "\x00") !== false) {
+ if ($formatted && strpos($body, "\x00") !== false) {
$body = str_replace("\x00", '', $body);
}
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc
index f75b219ff..aee31bb21 100644
--- a/program/steps/mail/compose.inc
+++ b/program/steps/mail/compose.inc
@@ -1286,12 +1286,12 @@ function rcmail_save_attachment(&$message, $pid)
$temp_dir = unslashify($rcmail->config->get('temp_dir'));
$path = tempnam($temp_dir, 'rcmAttmnt');
if ($fp = fopen($path, 'w')) {
- $message->get_part_content($pid, $fp);
+ $message->get_part_content($pid, $fp, true, 0, false);
fclose($fp);
} else
return false;
} else {
- $data = $message->get_part_content($pid);
+ $data = $message->get_part_content($pid, null, true, 0, false);
}
$mimetype = $part->ctype_primary . '/' . $part->ctype_secondary;