php-imap-client icon indicating copy to clipboard operation
php-imap-client copied to clipboard

[BUG] Empty section subtype value in IncomingMessage::getBody() causes bad, uncatchable error.

Open giuspe opened this issue 7 years ago • 1 comments

Bug See here: https://github.com/SSilence/php-imap-client/blob/a897a58f99638ab60536e947073d497e8154cb12/ImapClient/IncomingMessage.php#L365

image

While parsing message body it can happen (happened to me :) that the (parsed) section subtype is empty, resulting in a bad (uncatchable) error in the following lines (all the

$objNew->$subtype

calls are bound to fail badly).

A first workaround would be at least check for empty $subtype, and exclude the whole following section if is actually empty

image

(I have the fixed branch in my local system, I'll try to push + pull request in a few hours).

giuspe avatar Jul 30 '18 09:07 giuspe

Thanks. Ill be there with you open the pr!

mattparksjr avatar Jul 30 '18 15:07 mattparksjr