Ticket #23578: 23578.2.diff
File 23578.2.diff, 1.8 KB (added by , 8 years ago) |
---|
-
src/wp-includes/pluggable.php
365 365 return false; 366 366 } 367 367 368 // Set mail's subject and body369 $phpmailer->Subject = $subject;370 $phpmailer->Body = $message;371 372 368 // Set destination addresses, using appropriate methods for handling addresses 373 369 $address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' ); 374 370 … … 414 410 415 411 // Set Content-Type and charset 416 412 // If we don't have a content-type from the input headers 417 if ( ! isset( $content_type ) )413 if ( ! isset( $content_type ) ) { 418 414 $content_type = 'text/plain'; 415 } 419 416 420 417 /** 421 418 * Filters the wp_mail() content type. … … 429 426 $phpmailer->ContentType = $content_type; 430 427 431 428 // Set whether it's plaintext, depending on $content_type 432 if ( 'text/html' == $content_type ) 429 if ( 'text/html' == $content_type ) { 433 430 $phpmailer->IsHTML( true ); 434 431 432 if ( false !== strpos( $message, "\r\n" ) && false === strpos( $message, '<br' ) ) { 433 $message = nl2br( $message ); 434 } 435 436 $message = preg_replace( '/<(http.*?)>/', '<a href="$1">$1</a>', $message ); 437 } 438 435 439 // If we don't have a charset from the input headers 436 if ( ! isset( $charset ) )440 if ( ! isset( $charset ) ) { 437 441 $charset = get_bloginfo( 'charset' ); 442 } 438 443 439 // Set the content-type and charset440 441 444 /** 442 445 * Filters the default wp_mail() charset. 443 446 * … … 447 450 */ 448 451 $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); 449 452 453 // Set mail's subject and body 454 $phpmailer->Subject = $subject; 455 $phpmailer->Body = $message; 456 450 457 // Set custom headers 451 458 if ( !empty( $headers ) ) { 452 459 foreach ( (array) $headers as $name => $content ) {