}
} else { /* Treat as multipart/mixed */
foreach ($this->entities as $ent) {
- if((strtolower($ent->header->disposition->name) != 'attachment') &&
+ if(!(is_object($ent->header->disposition) && strtolower($ent->header->disposition->name) == 'attachment') &&
(!isset($ent->header->parameters['filename'])) &&
(!isset($ent->header->parameters['name'])) &&
(($ent->type0 != 'message') && ($ent->type1 != 'rfc822'))) {
foreach ($alt_order as $alt) {
if( ($alt == $type) && isset($this->entity_id) ) {
if ((count($this->entities) == 0) &&
- (!isset($ent->header->parameters['filename'])) &&
- (!isset($ent->header->parameters['name'])) &&
- (strtolower($this->header->disposition->name) != 'attachment')) {
+ (!isset($this->header->parameters['filename'])) &&
+ (!isset($this->header->parameters['name'])) &&
+ isset($this->header->disposition) && is_object($this->header->disposition) &&
+ !(is_object($this->header->disposition) && strtolower($this->header->disposition->name) == 'attachment')) {
$entity[] = $this->entity_id;
$found = true;
}
}
if(!$found) {
foreach ($this->entities as $ent) {
- if((strtolower($ent->header->disposition->name) != 'attachment') &&
+ if(!(is_object($ent->header->disposition) && strtolower($ent->header->disposition->name) == 'attachment') &&
(($ent->type0 != 'message') && ($ent->type1 != 'rfc822'))) {
$entity = $ent->findDisplayEntity($entity, $alt_order, $strict);
$found = true;
in_array($this->type1, array('plain', 'html', 'message')) &&
isset($this->entity_id)) {
if (count($this->entities) == 0) {
- if (strtolower($this->header->disposition->name) != 'attachment') {
+ if (!is_object($this->header->disposition) || strtolower($this->header->disposition->name) != 'attachment') {
$entity[] = $this->entity_id;
}
}