Ticket #4296: 4296.diff

File 4296.diff, 1.2 KB (added by Nazgul, 5 years ago)
  • wp-includes/pluggable.php

     
    193193                                $content = trim( $content ); 
    194194 
    195195                                // Mainly for legacy -- process a From: header if it's there 
    196                                 if ( $name == 'From' ) { 
     196                                if ( 'from' == strtolower( $name ) ) { 
    197197                                        if ( strpos( '<', $content ) !== false ) { 
    198198                                                // So... making my life hard again? 
    199199                                                $from_name = substr( $content, 0, strpos( '<', $content ) - 1 ); 
     
    206206                                        } else { 
    207207                                                $from_name = trim( $content ); 
    208208                                        } 
    209                                 } elseif ( $name == 'Content-Type' ) { 
     209                                } elseif ( 'content-type' == strtolower( $name ) ) { 
    210210                                        if ( strpos( ';', $content ) !== false ) { 
    211211                                                list( $type, $charset ) = explode( ';', $content ); 
    212212                                                $content_type = trim( $content_type ); 
     
    281281        } 
    282282 
    283283        // Set the content-type and charset 
    284         $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', 'text/plain' ); 
     284        $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', $content_type ); 
    285285        $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); 
    286286 
    287287        // Set custom headers