Changeset 43459 for branches/4.9
- Timestamp:
- 07/16/2018 02:23:26 PM (6 years ago)
- Location:
- branches/4.9
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.9
- Property svn:mergeinfo changed
/trunk merged: 43388,43390,43435
- Property svn:mergeinfo changed
-
branches/4.9/src/wp-admin/includes/file.php
r43448 r43459 2100 2100 $email_address = $request->email; 2101 2101 $export_file_url = get_post_meta( $request_id, '_export_file_url', true ); 2102 $site_name = is_multisite() ? get_site_option( 'site_name' ) : get_option( 'blogname');2103 $site_url = network_home_url();2102 $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 2103 $site_url = home_url(); 2104 2104 2105 2105 $content = str_replace( '###EXPIRATION###', $expiration_date, $content ); 2106 2106 $content = str_replace( '###LINK###', esc_url_raw( $export_file_url ), $content ); 2107 2107 $content = str_replace( '###EMAIL###', $email_address, $content ); 2108 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $site_name, ENT_QUOTES ), $content );2108 $content = str_replace( '###SITENAME###', $site_name, $content ); 2109 2109 $content = str_replace( '###SITEURL###', esc_url_raw( $site_url ), $content ); 2110 2110 … … 2113 2113 sprintf( 2114 2114 __( '[%s] Personal Data Export' ), 2115 wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )2115 $site_name 2116 2116 ), 2117 2117 $content -
branches/4.9/src/wp-includes/user.php
r43456 r43459 2658 2658 update_user_meta( $current_user->ID, '_new_email', $new_user_email ); 2659 2659 2660 if ( is_multisite() ) { 2661 $sitename = get_site_option( 'site_name' ); 2662 } else { 2663 $sitename = get_option( 'blogname' ); 2664 } 2660 $sitename = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 2665 2661 2666 2662 /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */ … … 2707 2703 $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail=' . $hash ) ), $content ); 2708 2704 $content = str_replace( '###EMAIL###', $_POST['email'], $content ); 2709 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $sitename, ENT_QUOTES ), $content );2710 $content = str_replace( '###SITEURL###', network_home_url(), $content );2711 2712 wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )), $content );2705 $content = str_replace( '###SITENAME###', $sitename, $content ); 2706 $content = str_replace( '###SITEURL###', home_url(), $content ); 2707 2708 wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), $sitename ), $content ); 2713 2709 2714 2710 $_POST['email'] = $current_user->user_email; … … 2920 2916 'description' => $action_description, 2921 2917 'manage_url' => $manage_url, 2922 'sitename' => get_option( 'blogname'),2918 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 2923 2919 'siteurl' => home_url(), 2924 2920 'admin_email' => $admin_email, … … 2972 2968 $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); 2973 2969 2974 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );2970 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 2975 2971 $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content ); 2976 2972 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); … … 2978 2974 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 2979 2975 2980 $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );2981 2982 2976 $subject = sprintf( 2983 2977 /* translators: 1: Site name. 2: Name of the confirmed action. */ 2984 2978 __( '[%1$s] Action Confirmed: %2$s' ), 2985 $ blogname,2979 $email_data['sitename'], 2986 2980 $action_description 2987 2981 ); … … 2993 2987 * 2994 2988 * @param string $subject The email subject. 2995 * @param string $ blogname The name of the site.2989 * @param string $sitename The name of the site. 2996 2990 * @param array $email_data { 2997 2991 * Data relating to the account action email. … … 3006 3000 * } 3007 3001 */ 3008 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $ blogname, $email_data );3002 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data ); 3009 3003 3010 3004 $email_sent = wp_mail( $email_data['admin_email'], $subject, $content ); … … 3036 3030 return; 3037 3031 } 3038 3039 $subject = sprintf(3040 /* translators: %s Site name. */3041 __( '[%s] Erasure Request Fulfilled' ),3042 wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )3043 );3044 3032 3045 3033 /** … … 3057 3045 'message_recipient' => $user_email, 3058 3046 'privacy_policy_url' => get_privacy_policy_url(), 3059 'sitename' => get_option( 'blogname'),3047 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 3060 3048 'siteurl' => home_url(), 3049 ); 3050 3051 $subject = sprintf( 3052 /* translators: %s: Site name. */ 3053 __( '[%s] Erasure Request Fulfilled' ), 3054 $email_data['sitename'] 3061 3055 ); 3062 3056 … … 3120 3114 $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); 3121 3115 3122 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );3116 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3123 3117 $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); 3124 3118 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); … … 3283 3277 'confirm_key' => wp_generate_user_request_key( $request_id ), 3284 3278 ), wp_login_url() ), 3285 'sitename' => is_multisite() ? get_site_option( 'site_name' ) : get_option( 'blogname'),3286 'siteurl' => network_home_url(),3279 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 3280 'siteurl' => home_url(), 3287 3281 ); 3288 3282 … … 3335 3329 $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content ); 3336 3330 $content = str_replace( '###EMAIL###', $email_data['email'], $content ); 3337 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );3331 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3338 3332 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3339 3333 3340 $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );3341 3342 3334 /* translators: Privacy data request subject. 1: Site name, 2: Name of the action */ 3343 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $ blogname, $email_data['description'] );3335 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] ); 3344 3336 3345 3337 /** … … 3349 3341 * 3350 3342 * @param string $subject The email subject. 3351 * @param string $ blogname The name of the site.3343 * @param string $sitename The name of the site. 3352 3344 * @param array $email_data { 3353 3345 * Data relating to the account action email. … … 3361 3353 * } 3362 3354 */ 3363 $subject = apply_filters( 'user_request_action_email_subject', $subject, $ blogname, $email_data );3355 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 3364 3356 3365 3357 return wp_mail( $email_data['email'], $subject, $content ); -
branches/4.9/tests/phpunit/tests/user.php
r43117 r43459 1425 1425 reset_phpmailer_instance(); 1426 1426 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 1429 1428 update_option( 'blogname', ''Test' blog's "name" has <html entities> &' ); 1430 1429 … … 1444 1443 1445 1444 // 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( ''Test' site's "name" has <html entities> &', $email->body, 'Email body does contains HTML entities' );1449 }1450 1451 1445 $this->assertContains( '\'Test\' blog\'s "name" has <html entities> &', $email->subject, 'Email subject does not contain the decoded HTML entities' ); 1452 1446 $this->assertNotContains( ''Test' blog's "name" has <html entities> &', $email->subject, 'Email subject does contains HTML entities' );
Note: See TracChangeset
for help on using the changeset viewer.