diff --git a/api/src/Mail.php b/api/src/Mail.php index 5642fba221..0a7c08eb9e 100644 --- a/api/src/Mail.php +++ b/api/src/Mail.php @@ -5574,12 +5574,12 @@ class Mail * @param string/int $_partID = '' , the partID, may be omitted * @param string $_folder folder to work on * @param boolean $_stream =false true: return a stream, false: return string, stream suppresses any caching - * @return string the message body + * @return ?string the message body or null if $_uid or $_partID not found */ function getMessageRawBody($_uid, $_partID = '', $_folder='', $_stream=false) { static $rawBody; - $body = []; + $body = null; if (empty($_folder)) $_folder = $this->sessionData['mailbox']?: $this->icServer->getCurrentMailbox(); $_uid = !(is_object($_uid) || is_array($_uid)) ? (array)$_uid : $_uid; diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index 08dda2556f..c67f8b7b5c 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2965,7 +2965,7 @@ $filter['before']= date("d-M-Y", $cutoffdate2); $file = $tmp_file; } - if (!($fp = Vfs::fopen($file,'wb')) || !fwrite($fp,$message)) + if (!is_string($message) || !($fp = Vfs::fopen($file,'wb')) || !fwrite($fp,$message)) { $res['msg'] = lang('Error saving %1!',$file); $res['success'] = false;