PEAR is archived and read-only

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

Home » Mail » Mail_mimeDecode » Bug #6495

Mail_mimeDecode: Some parts of body not included in decode object

Details

Submitted2006-01-15 16:41 UTC
Fromalex at wdg dot com dot ua
Assignedalan_k
StatusClosed
PackageMail_mimeDecode
PHP VersionIrrelevant
OSLinux
Roadmaps1.6.0

Comments

[2006-01-15 16:41 UTC] alex at wdg dot com dot ua

Description:
------------
Some email message don't have boundary string at the end of messages. In this case last part of body will missed. I offer follow variant:
function _boundarySplit($input, $boundary) {
$parts = array();
$bs_possible = substr($boundary, 2, -2);
$bs_check = '\"' . $bs_possible . '\"';
if ($boundary == $bs_check) {
$boundary = $bs_possible;
}
$tmp = explode('--' . $boundary, $input);
// CHANGES START -- check all elements of array
// and add to parts only not empty
for ($i = 1; $i < count($tmp); $i++) {
if (trim($tmp[$i])) {
$parts[] = $tmp[$i];
}
}
// CHANGES END
return $parts;
}