Make WordPress Core

Changeset 5764


Ignore:
Timestamp:
06/26/2007 08:18:56 PM (17 years ago)
Author:
markjaquith
Message:

Correctly grab Content-Type from old-school headers, skip blank headers. fixes #4296

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/pluggable.php

    r5763 r5764  
    184184            // Iterate through the raw headers
    185185            foreach ( $tempheaders as $header ) {
     186                if ( strpos($header, ':') === false )
     187                    continue;
    186188                // Explode them out
    187189                list( $name, $content ) = explode( ':', trim( $header ), 2 );
     
    208210                    if ( strpos( $content,';' ) !== false ) {
    209211                        list( $type, $charset ) = explode( ';', $content );
    210                         $content_type = trim( $content_type );
     212                        $content_type = trim( $type );
    211213                        $charset = trim( str_replace( array( 'charset=', '"' ), '', $charset ) );
    212214                    } else {
     
    267269    }
    268270
     271    $content_type = apply_filters( 'wp_mail_content_type', $content_type );
     272
    269273    // Set whether it's plaintext or not, depending on $content_type
    270274    if ( $content_type == 'text/html' ) {
     
    280284
    281285    // Set the content-type and charset
    282     $phpmailer->ContentType = apply_filters( 'wp_mail_content_type', $content_type );
    283286    $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset );
    284287
     
    520523    }
    521524
    522     $message_headers = "MIME-Version: 1.0\n"
    523         . "$from\n"
     525    $message_headers = "$from\n"
    524526        . "Content-Type: text/plain; charset=\"" . get_option('blog_charset') . "\"\n";
    525527
Note: See TracChangeset for help on using the changeset viewer.