Make WordPress Core


Ignore:
Timestamp:
07/27/2020 08:17:36 PM (4 years ago)
Author:
whyisjake
Message:

Mail: PHPMailer swap to use is_email for the default validator.

Prior to the PHPMailer update in 5.5, old version of the PHPMailer was setting the validator to 'auto' resulting in a sophisticated logic for determining what email address validation should be used. But the new version defaults to 'php', possibly leading to rejection of email addresses which were fine prior to the upgrade. Let's use the WordPress core function is_email() so that it can be fully pluggable.

Fixes #50720.
Props david.binda, ayeshrajans, Synchro, SergeyBiryukov, whyisjake.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/mail.php

    r48443 r48645  
    408408        $this->assertEquals( $expected_error_data, $call_args[0]->get_error_data() );
    409409    }
     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    }
    410418}
Note: See TracChangeset for help on using the changeset viewer.