[wp-trac] [WordPress Trac] #9284: wp_mail function does not properly process headers array

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 5 16:54:33 GMT 2009


#9284: wp_mail function does not properly process headers array
--------------------------+-------------------------------------------------
 Reporter:  gortsleigh    |       Owner:              
     Type:  defect (bug)  |      Status:  new         
 Priority:  normal        |   Milestone:  Unassigned  
Component:  Mail          |     Version:  2.7.1       
 Severity:  normal        |    Keywords:  wp_mail,mail
--------------------------+-------------------------------------------------
 wp_admin is supposed to accept mail headers either as a string or as an
 array, but if an array is specified the headers are processed differently
 than if a string is specified.

 The fix is below.
 {{{
 Index: pluggable.php
 ===================================================================
 --- pluggable.php       (revision 10712)
 +++ pluggable.php       (working copy)
 @@ -275,10 +275,14 @@
         // Headers
         if ( empty( $headers ) ) {
                 $headers = array();
 -       } elseif ( !is_array( $headers ) ) {
 -               // Explode the headers out, so this function can take both
 -               // string headers and an array of headers.
 -               $tempheaders = (array) explode( "\n", $headers );
 +       } else {
 +               if ( !is_array( $headers ) ) {
 +                       // Explode the headers out, so this function can
 take either
 +                       // string headers or an array of headers.
 +                       $tempheaders = (array) explode( "\n", $headers );
 +               } else {
 +                       $tempheaders = $headers;
 +               }
                 $headers = array();

                 // If it's actually got contents

 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9284>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list