PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Mail » Mail_Mime » Bug #4795

Error adding zero-byte attachments

Details

Submitted2005-07-12 04:39 UTC
Frombugs at juliano dot info
Assignedcipri
StatusClosed
PackageMail_Mime
PHP Version4.3.11
Roadmaps(Not assigned)

Comments

[2005-07-12 04:39 UTC] bugs at juliano dot info

Description:
------------
When adding a zero-byte attachment with $mime->addAttachment(), PHP returns an fread error:

Warning: fread(): Length parameter must be greater than 0. in /usr/share/pear/Mail/mime.php on line 292

Reproduce code:
---------------
$mime = new Mail_mime("\n");
$mime->addAttachment('emptyFile', 'text/plain');

Expected result:
----------------
No PHP errors being generated.

Actual result:
--------------
Warning: fread(): Length parameter must be greater than 0. in /usr/share/pear/Mail/mime.php on line 292