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 #2120

Undefined variable: parts in mimeDecode.php on line 469

Details

Submitted2004-08-13 08:30 UTC
Fromroy at pine dot nl
Assignedsean
StatusClosed
PackageMail_Mime
PHP Version4.3.8
OSFreeBSD
Roadmaps(Not assigned)

Comments

[2004-08-13 08:30 UTC] roy at pine dot nl

Description:
------------
It sometimes happens that there are no $parts found and the function will then generate a notice:

function _boundarySplit($input, $boundary)
{
$tmp = explode('--'.$boundary, $input);

for ($i=1; $i<count($tmp)-1; $i++) {
$parts[] = $tmp[$i];
}

return $parts;
}

You should probably add '$parts= array();' at the beginning of the function to fix the problem.

[2004-09-28 21:12 UTC] administrator at modomail dot com

Actuall, it's this line:

$parts[] = $tmp[$i];

That is the problem. Try:

function _boundarySplit($input, $boundary)
{
$parts = array();
$tmp = explode('--'.$boundary, $input);

for ($i=1; $i<count($tmp)-1; $i++) {
array_push ($parts, $tmp[$i]);
}

return $parts;
}

[2004-09-29 07:19 UTC] roy at pine dot nl

You are right.