Author: Frederik Holljen
Date: 2006-01-23 10:33:33 +0100 (Mon, 23 Jan 2006)
New Revision: 2000

Log:
- Fixed issue with double to and subject headers when using the MTA transport.
- Fixed tests that were broken because of the CR fix on friday.


Modified:
   packages/Mail/trunk/ChangeLog
   packages/Mail/trunk/src/interfaces/part.php
   packages/Mail/trunk/src/transports/transport_mta.php
   packages/Mail/trunk/tests/interfaces/part_test.php
   packages/Mail/trunk/tests/parts/data/ezcMailMultiPartTest_testGenerate.data

Modified: packages/Mail/trunk/ChangeLog
===================================================================
--- packages/Mail/trunk/ChangeLog       2006-01-23 09:04:27 UTC (rev 1999)
+++ packages/Mail/trunk/ChangeLog       2006-01-23 09:33:33 UTC (rev 2000)
@@ -1,6 +1,9 @@
 1.0 - [RELEASEDATE]
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-- ezcMailException now inherits from ezcBaseException and not Exception        
+- ezcMailException now inherits from ezcBaseException and not Exception
+- fixed bug: #7716: ezcMail needs support for Reply-To (we simply don't set it 
anymore.
+  Users can set the header themselves if they need to. 
(ezcMailPart::setHeader())
+- Fixed issue with double to and subject headers when using the MTA transport.
        
 1.0rc1 - Monday 16 January 2006
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Modified: packages/Mail/trunk/src/interfaces/part.php
===================================================================
--- packages/Mail/trunk/src/interfaces/part.php 2006-01-23 09:04:27 UTC (rev 
1999)
+++ packages/Mail/trunk/src/interfaces/part.php 2006-01-23 09:33:33 UTC (rev 
2000)
@@ -87,7 +87,7 @@
         $text = "";
         foreach ( $this->headers as $header => $value )
         {
-            if ( in_array( $header, $this->excludeHeaders ) === false )
+            if ( in_array( strtolower( $header ), $this->excludeHeaders ) === 
false )
             {
                 $text .= "$header: $value" . ezcMailTools::lineBreak();
             }
@@ -104,7 +104,12 @@
      */
     public function appendExcludeHeaders( array $headers )
     {
-        $this->excludeHeaders = array_merge( $this->excludeHeaders, $headers );
+        $lowerCaseHeaders = array();
+        foreach( $headers as $header )
+        {
+            $lowerCaseHeaders[] = strtolower( $header );
+        }
+        $this->excludeHeaders = array_merge( $this->excludeHeaders, 
$lowerCaseHeaders );
     }
 
     /**

Modified: packages/Mail/trunk/src/transports/transport_mta.php
===================================================================
--- packages/Mail/trunk/src/transports/transport_mta.php        2006-01-23 
09:04:27 UTC (rev 1999)
+++ packages/Mail/trunk/src/transports/transport_mta.php        2006-01-23 
09:33:33 UTC (rev 2000)
@@ -37,6 +37,7 @@
      */
     public function send( ezcMail $mail )
     {
+        $mail->appendExcludeHeaders( array( 'to', 'subject' ) );
         $success = mail( ezcMailTools::composeEmailAddresses( $mail->to ),
                          $mail->subject, $mail->generateBody(), 
$mail->generateHeaders() );
         if ( $success === false )

Modified: packages/Mail/trunk/tests/interfaces/part_test.php
===================================================================
--- packages/Mail/trunk/tests/interfaces/part_test.php  2006-01-23 09:04:27 UTC 
(rev 1999)
+++ packages/Mail/trunk/tests/interfaces/part_test.php  2006-01-23 09:33:33 UTC 
(rev 2000)
@@ -85,6 +85,18 @@
     }
 
     /**
+     * Check that it is possible to exlucde headers with appendExcludeHeaders
+     */
+    public function testGenerateHeadersWithExcludeCaseDifference()
+    {
+        $expectedResult = "From: [EMAIL PROTECTED]" . 
ezcMailTools::lineBreak();
+        $this->part->setHeader( "To", "[EMAIL PROTECTED]" );
+        $this->part->setHeader( "From", "[EMAIL PROTECTED]" );
+        $this->part->appendExcludeHeaders( array( "to" ) );
+        $this->assertEquals( $expectedResult, $this->part->generateHeaders() );
+    }
+
+    /**
      * Test generate method
      */
     public function testGenerate()

Modified: 
packages/Mail/trunk/tests/parts/data/ezcMailMultiPartTest_testGenerate.data
===================================================================
--- packages/Mail/trunk/tests/parts/data/ezcMailMultiPartTest_testGenerate.data 
2006-01-23 09:04:27 UTC (rev 1999)
+++ packages/Mail/trunk/tests/parts/data/ezcMailMultiPartTest_testGenerate.data 
2006-01-23 09:33:33 UTC (rev 2000)
@@ -1,6 +1,6 @@
 Content-Type: multipart/Test; boundary="pirate"
 
-This message is in MIME format. Since your mail reader does not understand
+This message is in MIME format. Since your mail reader does not understand
 this format, some or all of this message may not be legible.
 
 --pirate

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to