PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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