Changeset 54539
- Timestamp:
- 10/17/2022 12:34:37 PM (2 years ago)
- Location:
- branches/6.0
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.0
-
branches/6.0/src/wp-includes/pluggable.php
r53301 r54539 362 362 $phpmailer->clearCustomHeaders(); 363 363 $phpmailer->clearReplyTos(); 364 $phpmailer->Body = ''; 365 $phpmailer->AltBody = ''; 364 366 365 367 // Set "From" name and email. -
branches/6.0/tests/phpunit/tests/mail.php
r52800 r54539 454 454 $this->assertFalse( $result2 ); 455 455 } 456 457 /** 458 * Tests that AltBody is reset between each wp_mail call. 459 * 460 * @covers :wp_mail 461 */ 462 public function test_wp_mail_resets_properties() { 463 $wp_mail_set_text_message = function ( $phpmailer ) { 464 $phpmailer->AltBody = 'user1'; 465 }; 466 add_action( 'phpmailer_init', $wp_mail_set_text_message ); 467 wp_mail( 'user1@example.localhost', 'Test 1', '<p>demo</p>', 'Content-Type: text/html' ); 468 remove_action( 'phpmailer_init', $wp_mail_set_text_message ); 469 wp_mail( 'user2@example.localhost', 'Test 2', 'test2' ); 470 $phpmailer = $GLOBALS['phpmailer']; 471 $this->assertNotSame( 'user1', $phpmailer->AltBody ); 472 } 456 473 }
Note: See TracChangeset
for help on using the changeset viewer.