From e250f00d90df4a782639b868e619e539785122fb Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sun, 13 Sep 2015 03:55:59 -0400 Subject: [PATCH] Fix PHP warnings when sending mailvelope-encrypted mail --- program/steps/mail/sendmail.inc | 11 +++-------- 1 files changed, 3 insertions(+), 8 deletions(-) diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index bb32f6e..e58dce3 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -252,9 +252,10 @@ $isHtml = false; // clear unencrypted attachments - foreach ($COMPOSE['attachments'] as $attach) { + foreach ((array) $COMPOSE['attachments'] as $attach) { $RCMAIL->plugins->exec_hook('attachment_delete', $attach); } + $COMPOSE['attachments'] = array(); } @@ -504,13 +505,7 @@ 'PGP/MIME version identification' ); - // patch filename out of the version part - foreach ($MAIL_MIME->_parts as $_i => $_part) { - if ($_part['c_type'] == 'application/pgp-encrypted') { - $MAIL_MIME->_parts[$_i]['name'] = ''; - break; - } - } + // @TODO: remove filename out of the version part, required Mail_Mime changes $MAIL_MIME->addAttachment( $pgp_mime, -- Gitblit v1.9.1