Make WordPress Core

Ticket #44396: 44396.3.diff

File 44396.3.diff, 7.4 KB (added by desrosj, 8 years ago)
  • src/wp-includes/user.php

     
    27252725
    27262726                        return;
    27272727                }
    2728 
    27292728                $hash           = md5( $_POST['email'] . time() . wp_rand() );
    27302729                $new_user_email = array(
    27312730                        'hash'     => $hash,
     
    27332732                );
    27342733                update_user_meta( $current_user->ID, '_new_email', $new_user_email );
    27352734
    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 );
    27412736
    27422737                /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */
    27432738                $email_text = __(
     
    27842779                $content = str_replace( '###USERNAME###', $current_user->user_login, $content );
    27852780                $content = str_replace( '###ADMIN_URL###', esc_url( admin_url( 'profile.php?newuseremail=' . $hash ) ), $content );
    27862781                $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 );
    27892784
    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 );
    27912786
    27922787                $_POST['email'] = $current_user->user_email;
    27932788        }
     
    29972992                'user_email'  => $request_data->email,
    29982993                'description' => $action_description,
    29992994                'manage_url'  => $manage_url,
    3000                 'sitename'    => get_option( 'blogname' ),
     2995                'sitename'    => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
    30012996                'siteurl'     => home_url(),
    30022997                'admin_email' => $admin_email,
    30032998        );
     
    30493044         */
    30503045        $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
    30513046
    3052         $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );
     3047        $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
    30533048        $content = str_replace( '###USER_EMAIL###', $email_data['user_email'], $content );
    30543049        $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
    30553050        $content = str_replace( '###MANAGE_URL###', esc_url_raw( $email_data['manage_url'] ), $content );
    30563051        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    30573052
    3058         $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    3059 
    30603053        $subject = sprintf(
    30613054                /* translators: 1: Site name. 2: Name of the confirmed action. */
    30623055                __( '[%1$s] Action Confirmed: %2$s' ),
    3063                 $blogname,
     3056                $email_data['sitename'],
    30643057                $action_description
    30653058        );
    30663059
     
    30703063         * @since 4.9.7
    30713064         *
    30723065         * @param string $subject    The email subject.
    3073          * @param string $blogname   The name of the site.
     3066         * @param string $sitename   The name of the site.
    30743067         * @param array  $email_data {
    30753068         *     Data relating to the account action email.
    30763069         *
     
    30833076         *     @type string          $admin_email The administrator email receiving the mail.
    30843077         * }
    30853078         */
    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 );
    30873080
    30883081        $email_sent = wp_mail( $email_data['admin_email'], $subject, $content );
    30893082
     
    31143107                return;
    31153108        }
    31163109
    3117         $subject = sprintf(
    3118                 /* translators: %s Site name. */
    3119                 __( '[%s] Erasure Request Fulfilled' ),
    3120                 wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES )
    3121         );
    3122 
    31233110        /**
    31243111         * Filters the recipient of the data erasure fulfillment notification.
    31253112         *
     
    31343121                'request'            => $request_data,
    31353122                'message_recipient'  => $user_email,
    31363123                'privacy_policy_url' => get_privacy_policy_url(),
    3137                 'sitename'           => get_option( 'blogname' ),
     3124                'sitename'           => wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ),
    31383125                'siteurl'            => home_url(),
    31393126        );
    31403127
     3128        $subject  = sprintf(
     3129        /* translators: %s Site name. */
     3130                __( '[%s] Erasure Request Fulfilled' ),
     3131                $email_data['sitename']
     3132        );
     3133
    31413134        if ( empty( $email_data['privacy_policy_url'] ) ) {
    31423135                /* translators: Do not translate SITENAME, SITEURL; those are placeholders. */
    31433136                $email_text = __(
     
    31663159All at ###SITENAME###
    31673160###SITEURL###'
    31683161                );
     3162
    31693163        }
    31703164
    31713165        /**
     
    31973191         */
    31983192        $content = apply_filters( 'user_confirmed_action_email_content', $email_text, $email_data );
    31993193
    3200         $content = str_replace( '###SITENAME###', wp_specialchars_decode( $email_data['sitename'], ENT_QUOTES ), $content );
     3194        $content = str_replace( '###SITENAME###', $email_data['sitename'], $content );
    32013195        $content = str_replace( '###PRIVACY_POLICY_URL###', $email_data['privacy_policy_url'], $content );
    32023196        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    32033197
     
    33603354                        'request_id'  => $request_id,
    33613355                        'confirm_key' => wp_generate_user_request_key( $request_id ),
    33623356                ), 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(),
    33653359        );
    33663360
    33673361        /* translators: Do not translate DESCRIPTION, CONFIRM_URL, SITENAME, SITEURL: those are placeholders. */
     
    34123406        $content = str_replace( '###DESCRIPTION###', $email_data['description'], $content );
    34133407        $content = str_replace( '###CONFIRM_URL###', esc_url_raw( $email_data['confirm_url'] ), $content );
    34143408        $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 );
    34163410        $content = str_replace( '###SITEURL###', esc_url_raw( $email_data['siteurl'] ), $content );
    34173411
    3418         $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
    3419 
    34203412        /* 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'] );
    34223414
    34233415        /**
    34243416         * Filters the subject of the email sent when an account action is attempted.
     
    34263418         * @since 4.9.6
    34273419         *
    34283420         * @param string $subject    The email subject.
    3429          * @param string $blogname   The name of the site.
     3421         * @param string $sitename   The name of the site.
    34303422         * @param array  $email_data {
    34313423         *     Data relating to the account action email.
    34323424         *
     
    34383430         *     @type string          $siteurl     The site URL sending the mail.
    34393431         * }
    34403432         */
    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 );
    34423434
    34433435        return wp_mail( $email_data['email'], $subject, $content );
    34443436}