WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/03/2018 09:00:16 PM (12 months ago)
Author:
SergeyBiryukov
Message:

Privacy: Ensure the user request email is sent in the requested user's locale (or the site's default locale if they are not a registered user) when the administrator creating the request uses a different locale.

Props desrosj, Chouby, iandunn, lbenicio, birgire, earnjam, swissspidy, garrett-eclipse.
Merges [43568] to the 4.9 branch.
Fixes #43985.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/tests/phpunit/tests/privacy/wpPrivacySendPersonalDataExportEmail.php

    r43612 r43614  
    4040     * @since 4.9.6
    4141     */
    42     function setUp() {
     42    public function setUp() {
    4343        parent::setUp();
    4444        reset_phpmailer_instance();
     
    5050     * @since 4.9.6
    5151     */
    52     function tearDown() {
     52    public function tearDown() {
    5353        reset_phpmailer_instance();
    5454        parent::tearDown();
     
    9696        $email_sent = wp_privacy_send_personal_data_export_email( $request_id );
    9797        $this->assertWPError( $email_sent );
    98         $this->assertSame( 'invalid', $email_sent->get_error_code() );
     98        $this->assertSame( 'invalid_request', $email_sent->get_error_code() );
    9999
    100100        $request_id = PHP_INT_MAX;
    101101        $email_sent = wp_privacy_send_personal_data_export_email( $request_id );
    102102        $this->assertWPError( $email_sent );
    103         $this->assertSame( 'invalid', $email_sent->get_error_code() );
     103        $this->assertSame( 'invalid_request', $email_sent->get_error_code() );
    104104    }
    105105
     
    112112        add_filter( 'wp_mail_from', '__return_empty_string' ); // Cause `wp_mail()` to return false.
    113113        $email_sent = wp_privacy_send_personal_data_export_email( self::$request_id );
    114         remove_filter( 'wp_mail_from', '__return_empty_string' );
    115114
    116115        $this->assertWPError( $email_sent );
    117         $this->assertSame( 'error', $email_sent->get_error_code() );
     116        $this->assertSame( 'privacy_email_error', $email_sent->get_error_code() );
    118117    }
    119118
     
    126125        add_filter( 'wp_privacy_export_expiration', array( $this, 'modify_export_expiration' ) );
    127126        wp_privacy_send_personal_data_export_email( self::$request_id );
    128         remove_filter( 'wp_privacy_export_expiration', array( $this, 'modify_export_expiration' ) );
    129127
    130128        $mailer = tests_retrieve_phpmailer_instance();
     
    153151        add_filter( 'wp_privacy_personal_data_email_content', array( $this, 'modify_email_content' ), 10, 2 );
    154152        wp_privacy_send_personal_data_export_email( self::$request_id );
    155         remove_filter( 'wp_privacy_personal_data_email_content', array( $this, 'modify_email_content' ) );
    156153
    157154        $mailer = tests_retrieve_phpmailer_instance();
Note: See TracChangeset for help on using the changeset viewer.