From d70014ad3ec18db782882abdce51e898fb39d712 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Tue, 30 May 2017 13:45:50 +0000 Subject: [PATCH] mail: notice if malformed mail is corrected git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3737 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- mail.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mail.php b/mail.php index e2dd61c..19f466e 100644 --- a/mail.php +++ b/mail.php @@ -361,9 +361,13 @@ class mail } if ($prev !== "") { - list ($head, $value) = explode (": ", $prev, 2); - $value .= $prevCR; - $headersArray[][$head] = $value; + $exp = explode (": ", $prev, 2); + if (array_key_exists (1, $exp)) + { + list ($head, $value) = $exp; + $value .= $prevCR; + $headersArray[][$head] = $value; + } } } $contentType = $this->getHeaderValue ("Content-Type", $headersArray); @@ -1341,7 +1345,7 @@ class mail /** Create a messageID * @return string the textual MessageID */ - private function getMessageID () + public function getMessageID () { $data = openssl_random_pseudo_bytes (16); $data[6] = chr(ord($data[6]) & 0x0f | 0x40); // set version to 0010