Browse Source

[ZF-7702] E-Mail is sent to Reply-To if given

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@18566 44c647ce-9c0f-0410-b52a-842ac1e357ba
yoshida@zend.co.jp 16 năm trước cách đây
mục cha
commit
19b020a21d
1 tập tin đã thay đổi với 17 bổ sung17 xóa
  1. 17 17
      library/Zend/Mail.php

+ 17 - 17
library/Zend/Mail.php

@@ -91,12 +91,6 @@ class Zend_Mail extends Zend_Mime_Message
      */
     protected $_to = array();
 
-    /*
-     * Reply-To header
-     * @var string
-     */
-    protected $_replyTo;
-    
     /**
      * Array of all recipients
      * @var array
@@ -104,6 +98,12 @@ class Zend_Mail extends Zend_Mime_Message
     protected $_recipients = array();
 
     /**
+     * Reply-To header
+     * @var string
+     */
+    protected $_replyTo = null;
+
+    /**
      * Return-Path header
      * @var string
      */
@@ -628,22 +628,22 @@ class Zend_Mail extends Zend_Mime_Message
      */
     public function setReplyTo($email, $name = null)
     {
-    	if($this->_replyTo === null) {
-    		$email = $this->_filterEmail($email);
-    		$name = $this->_filterEmail($name);
-    		$this->_replyTo = $email;
-    		$this->_storeHeader('Reply-To', $this->_formatAddress($email, $name), true);
-    	} else {
-    		/**
-    		 * @see Zend_Mail_Exception
-    		 */
+        if($this->_replyTo === null) {
+            $email = $this->_filterEmail($email);
+            $name  = $this->_filterName($name);
+            $this->_replyTo = $email;
+            $this->_storeHeader('Reply-To', $this->_formatAddress($email, $name), true);
+        } else {
+            /**
+             * @see Zend_Mail_Exception
+             */
             require_once 'Zend/Mail/Exception.php';
             throw new Zend_Mail_Exception('Reply-To Header set twice');
         }
 
         return $this;
     }
-    
+
     /**
      * Returns the sender of the mail
      *
@@ -663,7 +663,7 @@ class Zend_Mail extends Zend_Mime_Message
     {
         return $this->_replyTo;
     }
-    
+
     /**
      * Clears the sender from the mail
      *