diff --git a/mail.php b/mail.php index efd336a..da3fef0 100644 --- a/mail.php +++ b/mail.php @@ -239,7 +239,8 @@ class mail */ private function readMailContentRecurse ($partinfo, $sectionIDParent=false) { - if (substr ($partinfo["_contentType"], 0, 10) === "multipart/") + if (key_exists ("_contentType", $partinfo) && + substr ($partinfo["_contentType"], 0, 10) === "multipart/") { // multipart/alternative, multipart/related, multipart/mixed // Remove the content, as it is not valuable (will be stored in childs) @@ -911,6 +912,8 @@ class mail $res = array (); foreach ($this->sections as $sectionID=>$section) { + if (! key_exists ("_headersArray", $section)) + continue; $disposition = $this->getHeaderValue ("Content-Disposition", $section["_headersArray"]); if ($disposition === false) @@ -1202,7 +1205,8 @@ class mail if ($headers === null) { $sectionMainID = $this->sectionMainID (); - if ($sectionMainID === false) + if ($sectionMainID === false || + ! key_exists ("_headersArray", $this->sections[$sectionMainID])) $headers = array (); else $headers = $this->sections[$sectionMainID]["_headersArray"]; @@ -1228,7 +1232,8 @@ class mail if ($headers === null) { $sectionMainID = $this->sectionMainID (); - if ($sectionMainID === false) + if ($sectionMainID === false || + ! key_exists ("_headersArray", $this->sections[$sectionMainID])) $headers = array (); else $headers = $this->sections[$sectionMainID]["_headersArray"];