Ticket #44396: 44396.3.diff
| File 44396.3.diff, 7.4 KB (added by , 8 years ago) |
|---|
-
src/wp-includes/user.php
2725 2725 2726 2726 return; 2727 2727 } 2728 2729 2728 $hash = md5( $_POST['email'] . time() . wp_rand() ); 2730 2729 $new_user_email = array( 2731 2730 'hash' => $hash, … … 2733 2732 ); 2734 2733 update_user_meta( $current_user->ID, '_new_email', $new_user_email ); 2735 2734 2736 if ( is_multisite() ) { 2737 $sitename = get_site_option( 'site_name' ); 2738 } else { 2739 $sitename = get_option( 'blogname' ); 2740 } 2735 $sitename = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 2741 2736 2742 2737 /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */ 2743 2738 $email_text = __( … … 2784 2779 $content = str_replace( '###USERNAME###', $current_user->user_login, $content ); 2785 2780 $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail=' . $hash ) ), $content ); 2786 2781 $content = str_replace( '###EMAIL###', $_POST['email'], $content ); 2787 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $sitename, ENT_QUOTES ), $content );2788 $content = str_replace( '###SITEURL###', network_home_url(), $content );2782 $content = str_replace( '###SITENAME###', $sitename, $content ); 2783 $content = str_replace( '###SITEURL###', home_url(), $content ); 2789 2784 2790 wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )), $content );2785 wp_mail( $_POST['email'], sprintf( __( '[%s] New Email Address' ), $sitename ), $content ); 2791 2786 2792 2787 $_POST['email'] = $current_user->user_email; 2793 2788 } … … 2997 2992 'user_email' => $request_data->email, 2998 2993 'description' => $action_description, 2999 2994 'manage_url' => $manage_url, 3000 'sitename' => get_option( 'blogname'),2995 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 3001 2996 'siteurl' => home_url(), 3002 2997 'admin_email' => $admin_email, 3003 2998 ); … … 3049 3044 */ 3050 3045 $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); 3051 3046 3052 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );3047 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3053 3048 $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content ); 3054 3049 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 3055 3050 $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content ); 3056 3051 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3057 3052 3058 $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );3059 3060 3053 $subject = sprintf( 3061 3054 /* translators: 1: Site name. 2: Name of the confirmed action. */ 3062 3055 __( '[%1$s] Action Confirmed: %2$s' ), 3063 $ blogname,3056 $email_data['sitename'], 3064 3057 $action_description 3065 3058 ); 3066 3059 … … 3070 3063 * @since 4.9.7 3071 3064 * 3072 3065 * @param string $subject The email subject. 3073 * @param string $ blogname The name of the site.3066 * @param string $sitename The name of the site. 3074 3067 * @param array $email_data { 3075 3068 * Data relating to the account action email. 3076 3069 * … … 3083 3076 * @type string $admin_email The administrator email receiving the mail. 3084 3077 * } 3085 3078 */ 3086 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $ blogname, $email_data );3079 $subject = apply_filters( 'user_request_confirmed_email_subject', $subject, $email_data['sitename'], $email_data ); 3087 3080 3088 3081 $email_sent = wp_mail( $email_data['admin_email'], $subject, $content ); 3089 3082 … … 3114 3107 return; 3115 3108 } 3116 3109 3117 $subject = sprintf(3118 /* translators: %s Site name. */3119 __( '[%s] Erasure Request Fulfilled' ),3120 wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )3121 );3122 3123 3110 /** 3124 3111 * Filters the recipient of the data erasure fulfillment notification. 3125 3112 * … … 3134 3121 'request' => $request_data, 3135 3122 'message_recipient' => $user_email, 3136 3123 'privacy_policy_url' => get_privacy_policy_url(), 3137 'sitename' => get_option( 'blogname'),3124 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 3138 3125 'siteurl' => home_url(), 3139 3126 ); 3140 3127 3128 $subject = sprintf( 3129 /* translators: %s Site name. */ 3130 __( '[%s] Erasure Request Fulfilled' ), 3131 $email_data['sitename'] 3132 ); 3133 3141 3134 if ( empty( $email_data['privacy_policy_url'] ) ) { 3142 3135 /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */ 3143 3136 $email_text = __( … … 3166 3159 All at ###SITENAME### 3167 3160 ###SITEURL###' 3168 3161 ); 3162 3169 3163 } 3170 3164 3171 3165 /** … … 3197 3191 */ 3198 3192 $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data ); 3199 3193 3200 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );3194 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3201 3195 $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content ); 3202 3196 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3203 3197 … … 3360 3354 'request_id' => $request_id, 3361 3355 'confirm_key' => wp_generate_user_request_key( $request_id ), 3362 3356 ), wp_login_url() ), 3363 'sitename' => is_multisite() ? get_site_option( 'site_name' ) : get_option( 'blogname'),3364 'siteurl' => network_home_url(),3357 'sitename' => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ), 3358 'siteurl' => home_url(), 3365 3359 ); 3366 3360 3367 3361 /* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */ … … 3412 3406 $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content ); 3413 3407 $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content ); 3414 3408 $content = str_replace( '###EMAIL###', $email_data['email'], $content ); 3415 $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );3409 $content = str_replace( '###SITENAME###', $email_data['sitename'], $content ); 3416 3410 $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content ); 3417 3411 3418 $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );3419 3420 3412 /* translators: Privacy data request subject. 1: Site name, 2: Name of the action */ 3421 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $ blogname, $email_data['description'] );3413 $subject = sprintf( __( '[%1$s] Confirm Action: %2$s' ), $email_data['sitename'], $email_data['description'] ); 3422 3414 3423 3415 /** 3424 3416 * Filters the subject of the email sent when an account action is attempted. … … 3426 3418 * @since 4.9.6 3427 3419 * 3428 3420 * @param string $subject The email subject. 3429 * @param string $ blogname The name of the site.3421 * @param string $sitename The name of the site. 3430 3422 * @param array $email_data { 3431 3423 * Data relating to the account action email. 3432 3424 * … … 3438 3430 * @type string $siteurl The site URL sending the mail. 3439 3431 * } 3440 3432 */ 3441 $subject = apply_filters( 'user_request_action_email_subject', $subject, $ blogname, $email_data );3433 $subject = apply_filters( 'user_request_action_email_subject', $subject, $email_data['sitename'], $email_data ); 3442 3434 3443 3435 return wp_mail( $email_data['email'], $subject, $content ); 3444 3436 }