瀏覽代碼

Prevent a warning when sending an email with no recipient in To:

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3262 a333f486-631f-4898-b8df-5754b55c2be0
dflaven 11 年之前
父節點
當前提交
bcf900f066
共有 2 個文件被更改,包括 6 次插入0 次删除
  1. 5 0
      core/email.class.inc.php
  2. 1 0
      lib/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php

+ 5 - 0
core/email.class.inc.php

@@ -321,6 +321,11 @@ class EMail
 	public function GetRecipientTO($bAsString = false)
 	{
 		$aRes = $this->m_oMessage->getTo();
+		if ($aRes === false)
+		{
+			// There is no "To" header field
+			$aRes = array();
+		}
 		if ($bAsString)
 		{
 			$aStrings = array();

+ 1 - 0
lib/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php

@@ -595,6 +595,7 @@ class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity
         if ($this->_headers->has($field)) {
             return $this->_headers->get($field)->getFieldBodyModel();
         }
+        return false;
     }
 
     /**