Ticket #9913: 9913.diff
File 9913.diff, 1.4 KB (added by , 16 years ago) |
---|
-
wp-includes/pluggable.php
249 249 * @param string $message Message contents 250 250 * @param string|array $headers Optional. Additional headers. 251 251 * @param string|array $attachments Optional. Files to attach. 252 * @param bool $preserve_quotes Optional. Preserve encoded quotes in plain text emails. 252 253 * @return bool Whether the email contents were sent successfully. 253 254 */ 254 function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) {255 function wp_mail( $to, $subject, $message, $headers = '', $attachments = array(), $preserve_quotes = false ) { 255 256 // Compact the input, apply the filters, and extract them back out 256 257 extract( apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ) ); 257 258 … … 337 338 } 338 339 } 339 340 341 if ( $preserve_quotes != true && ( !isset( $content_type ) || $content_type = 'text/plain' ) ) { 342 // Ensure we don't send encoded quotes in plain text emails 343 $encoded_quotes = array( '"', ''' ); 344 $decoded_quotes = array( '"', "'" ); 345 $subject = str_replace( $encoded_quotes, $decoded_quotes, $subject ); 346 $message = str_replace( $encoded_quotes, $decoded_quotes, $message ); 347 } 348 340 349 // Empty out the values that may be set 341 350 $phpmailer->ClearAddresses(); 342 351 $phpmailer->ClearAllRecipients();