Skip to content

Commit

Permalink
- fixed issue SSilence#225 from giuspe
Browse files Browse the repository at this point in the history
  • Loading branch information
viacoding1 committed Jan 28, 2019
1 parent 90c083d commit 8c94035
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions ImapClient/IncomingMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,27 +362,29 @@ protected function getBody()
foreach ($this->getSections(self::SECTION_BODY) as $section) {
$obj = $this->getSection($section, array('class' => $subType));
$subtype = strtolower($obj->__get('structure')->subtype);
if (!isset($objNew->$subtype)) {
$objNew->$subtype = $obj;
} else {
$subtype = $subtype.'_'.$i;
$objNew->$subtype = $obj;
$i++;
}
$objNew->info[] = $obj;
$objNew->types[] = $subtype;
/*
* Set charset
*/
foreach ($objNew->$subtype->__get('structure')->parameters as $parameter) {
$attribute = strtolower($parameter->attribute);
if ($attribute === 'charset') {
$value = strtolower($parameter->value);
/*
* Here must be array, but
*/
//$objNew->$subtype->charset[] = $value;
$objNew->$subtype->charset = $value;
if(!empty($subtype)) {
if (!isset($objNew->$subtype)) {
$objNew->$subtype = $obj;
} else {
$subtype = $subtype.'_'.$i;
$objNew->$subtype = $obj;
$i++;
}
$objNew->info[] = $obj;
$objNew->types[] = $subtype;
/*
* Set charset
*/
foreach ($objNew->$subtype->__get('structure')->parameters as $parameter) {
$attribute = strtolower($parameter->attribute);
if ($attribute === 'charset') {
$value = strtolower($parameter->value);
/*
* Here must be array, but
*/
//$objNew->$subtype->charset[] = $value;
$objNew->$subtype->charset = $value;
}
}
}
}
Expand Down

0 comments on commit 8c94035

Please sign in to comment.