mail: allow header to be set to empty
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3710 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
17
mail.php
17
mail.php
@@ -228,7 +228,8 @@ class mail
|
||||
$this->sections = array ();
|
||||
$this->completeEmailEML = $content;
|
||||
$partinfo = $this->parseMessagePart ($content);
|
||||
$this->readMailContentRecurse ($partinfo);
|
||||
if ($partinfo !== null)
|
||||
$this->readMailContentRecurse ($partinfo);
|
||||
}
|
||||
|
||||
/** Read the content of the mail and allow the content to be also multipart.
|
||||
@@ -272,6 +273,8 @@ class mail
|
||||
if ($parts[$i] === "")
|
||||
continue;
|
||||
$messagePart = $this->parseMessagePart ($parts[$i]);
|
||||
if ($messagePart === null)
|
||||
continue;
|
||||
$messagePart["_parentID"] = $sectionIDParent;
|
||||
$sectionIDChild = $this->sectionAdd ($messagePart);
|
||||
$this->sectionAddChild ($sectionIDParent, $sectionIDChild);
|
||||
@@ -342,7 +345,7 @@ class mail
|
||||
//trigger_error ("Malformed mail provided: no section header",
|
||||
// E_USER_NOTICE);
|
||||
$prev = "";
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
list ($head, $value) = $exp;
|
||||
$value .= $prevCR;
|
||||
@@ -365,10 +368,16 @@ class mail
|
||||
}
|
||||
$contentType = $this->getHeaderValue ("Content-Type", $headersArray);
|
||||
if ($contentType === false)
|
||||
throw new \Exception ("No Content-Type Header defined", 500);
|
||||
{
|
||||
//throw new \Exception ("No Content-Type Header defined", 500);
|
||||
return;
|
||||
}
|
||||
$contentTypeArray = $this->contentTypeAnalyze ($contentType);
|
||||
if (! isset ($contentTypeArray["Content-Type"]))
|
||||
throw new \Exception ("Can't parse the Content-Type", 500);
|
||||
{
|
||||
//throw new \Exception ("Can't parse the Content-Type", 500);
|
||||
return;
|
||||
}
|
||||
$contentTransferEncoding =
|
||||
$this->getHeaderValue ("Content-Transfer-Encoding",
|
||||
$headersArray);
|
||||
|
||||
Reference in New Issue
Block a user