Changeset 48645
- Timestamp:
- 07/27/2020 08:17:36 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r48601 r48645 217 217 require_once ABSPATH . WPINC . '/PHPMailer/Exception.php'; 218 218 $phpmailer = new PHPMailer\PHPMailer\PHPMailer( true ); 219 220 $phpmailer::$validator = static function ( $email ) { 221 return (bool) is_email( $email ); 222 }; 219 223 } 220 224 -
trunk/tests/phpunit/includes/mock-mailer.php
r48058 r48645 97 97 $mailer = tests_retrieve_phpmailer_instance(); 98 98 if ( $mailer ) { 99 $GLOBALS['phpmailer'] = new MockPHPMailer( true ); 99 $mailer = new MockPHPMailer( true ); 100 $mailer::$validator = static function ( $email ) { 101 return (bool) is_email( $email ); 102 }; 103 104 $GLOBALS['phpmailer'] = $mailer; 100 105 return true; 101 106 } -
trunk/tests/phpunit/tests/mail.php
r48443 r48645 408 408 $this->assertEquals( $expected_error_data, $call_args[0]->get_error_data() ); 409 409 } 410 411 /** 412 * @ticket 50720 413 */ 414 function test_phpmailer_validator() { 415 $phpmailer = $GLOBALS['phpmailer']; 416 $this->assertTrue( $phpmailer->validateAddress( 'foo@192.168.1.1' ), 'Assert PHPMailer accepts IP address email addresses' ); 417 } 410 418 }
Note: See TracChangeset
for help on using the changeset viewer.