Changeset 18006
- Timestamp:
- 05/23/2011 11:14:05 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/pluggable.php
r17753 r18006 297 297 } 298 298 $headers = array(); 299 $cc = array(); 300 $bcc = array(); 299 301 300 302 // If it's actually got contents … … 402 404 foreach ( (array) $to as $recipient ) { 403 405 try { 404 $phpmailer->AddAddress( trim( $recipient ) ); 406 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" 407 $recipient_name = ''; 408 if( preg_match( '/(.+)\s?<(.+)>/', $recipient, $matches ) ) { 409 if ( count( $matches ) == 3 ) { 410 $recipient_name = $matches[1]; 411 $recipient = $matches[2]; 412 } 413 } 414 $phpmailer->AddAddress( trim( $recipient ), $recipient_name); 405 415 } catch ( phpmailerException $e ) { 406 416 continue; … … 416 426 foreach ( (array) $cc as $recipient ) { 417 427 try { 418 $phpmailer->AddCc( trim($recipient) ); 428 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" 429 $recipient_name = ''; 430 if( preg_match( '/(.+)\s?<(.+)>/', $recipient, $matches ) ) { 431 if ( count( $matches ) == 3 ) { 432 $recipient_name = $matches[1]; 433 $recipient = $matches[2]; 434 } 435 } 436 $phpmailer->AddCc( trim($recipient), $recipient_name ); 419 437 } catch ( phpmailerException $e ) { 420 438 continue; … … 426 444 foreach ( (array) $bcc as $recipient) { 427 445 try { 428 $phpmailer->AddBcc( trim($recipient) ); 446 // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" 447 $recipient_name = ''; 448 if( preg_match( '/(.+)\s?<(.+)>/', $recipient, $matches ) ) { 449 if ( count( $matches ) == 3 ) { 450 $recipient_name = $matches[1]; 451 $recipient = $matches[2]; 452 } 453 } 454 $phpmailer->AddBcc( trim($recipient), $recipient_name ); 429 455 } catch ( phpmailerException $e ) { 430 456 continue;
Note: See TracChangeset
for help on using the changeset viewer.