Make WordPress Core


Ignore:
Timestamp:
07/16/2018 02:23:26 PM (6 years ago)
Author:
SergeyBiryukov
Message:

Privacy: Use consistent values for the site name and URL used in notification emails.

The functions send_confirmation_on_profile_email(), _wp_privacy_send_request_confirmation_notification(), _wp_privacy_send_erasure_fulfillment_notification(), and wp_send_user_request() all include a title and URL indicating the current site. However, so far they have dealt with those values inconsistently, sometimes using the site values, other times using the network values if in a multisite. This changeset ensures that only the current site is taken into account in all cases and that special characters in the site name are consistently decoded.

Props subrataemfluence, desrosj.
Merges [43388], [43390], and [43435] to the 4.9 branch.
Fixes #44396.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/tests/phpunit/tests/user.php

    r43117 r43459  
    14251425        reset_phpmailer_instance();
    14261426
    1427         // Give the site and blog a name containing HTML entities
    1428         update_site_option( 'site_name', ''Test' site's "name" has <html entities> &' );
     1427        // Give the site a name containing HTML entities
    14291428        update_option( 'blogname', ''Test' blog's "name" has <html entities> &' );
    14301429
     
    14441443
    14451444        // Assert that HTML entites have been decoded in body and subject
    1446         if ( is_multisite() ) {
    1447             $this->assertContains( '\'Test\' site\'s "name" has <html entities> &', $email->body, 'Email body does not contain the decoded HTML entities' );
    1448             $this->assertNotContains( '&#039;Test&#039; site&#039;s &quot;name&quot; has &lt;html entities&gt; &amp;', $email->body, 'Email body does contains HTML entities' );
    1449         }
    1450 
    14511445        $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email subject does not contain the decoded HTML entities' );
    14521446        $this->assertNotContains( '&#039;Test&#039; blog&#039;s &quot;name&quot; has &lt;html entities&gt; &amp;', $email->subject, 'Email subject does contains HTML entities' );
Note: See TracChangeset for help on using the changeset viewer.