Home » Mail » Mail_Mime » Bug #2120
Undefined variable: parts in mimeDecode.php on line 469
Details
| Submitted | 2004-08-13 08:30 UTC |
|---|---|
| From | roy at pine dot nl |
| Assigned | sean |
| Status | Closed |
| Package | Mail_Mime |
| PHP Version | 4.3.8 |
| OS | FreeBSD |
| 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.