Changeset 11136 for trunk/wp-includes/pluggable.php
- Timestamp:
- 04/30/2009 07:25:47 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/pluggable.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r11109 r11136 285 285 // Iterate through the raw headers 286 286 foreach ( (array) $tempheaders as $header ) { 287 if ( strpos($header, ':') === false ) 287 if ( strpos($header, ':') === false ) { 288 if ( false !== stripos( $header, 'boundary=' ) ) { 289 $parts = preg_split('/boundary=/i', trim( $header ) ); 290 $boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) ); 291 } 288 292 continue; 293 } 289 294 // Explode them out 290 295 list( $name, $content ) = explode( ':', trim( $header ), 2 ); … … 312 317 list( $type, $charset ) = explode( ';', $content ); 313 318 $content_type = trim( $type ); 314 $charset = trim( str_replace( array( 'charset=', '"' ), '', $charset ) ); 319 if ( false !== stripos( $charset, 'charset=' ) ) { 320 $charset = trim( str_replace( array( 'charset=', '"' ), '', $charset ) ); 321 } elseif ( false !== stripos( $charset, 'boundary=' ) ) { 322 $boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset ) ); 323 $charset = ''; 324 } 315 325 } else { 316 326 $content_type = trim( $content ); … … 394 404 $content_type = apply_filters( 'wp_mail_content_type', $content_type ); 395 405 406 $phpmailer->ContentType = $content_type; 407 396 408 // Set whether it's plaintext or not, depending on $content_type 397 409 if ( $content_type == 'text/html' ) { 398 410 $phpmailer->IsHTML( true ); 399 } else {400 $phpmailer->IsHTML( false );401 411 } 402 412 … … 413 423 foreach( (array) $headers as $name => $content ) { 414 424 $phpmailer->AddCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); 425 } 426 if ( false !== stripos( $content_type, 'multipart' ) && ! empty($boundary) ) { 427 $phpmailer->AddCustomHeader( sprintf( "Content-Type: %s;\n\t boundary=\"%s\"", $content_type, $boundary ) ); 415 428 } 416 429 }
Note: See TracChangeset
for help on using the changeset viewer.