WordPress.org

Make WordPress Core

Changeset 41578


Ignore:
Timestamp:
09/23/2017 11:43:28 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Login and Registration: Replace home URL in password reset email with the site name to avoid confusing the user with multiple links.

Props Presskopp, code-monkey.
Fixes #38328.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r41556 r41578  
    325325    }
    326326
    327     $message = __('Someone has requested a password reset for the following account:') . "\r\n\r\n";
    328     $message .= network_home_url( '/' ) . "\r\n\r\n";
    329     $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    330     $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n";
    331     $message .= __('To reset your password, visit the following address:') . "\r\n\r\n";
    332     $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n";
    333 
    334327    if ( is_multisite() ) {
    335         $blogname = get_network()->site_name;
     328        $site_name = get_network()->site_name;
    336329    } else {
    337330        /*
     
    339332         * in sanitize_option we want to reverse this for the plain text arena of emails.
    340333         */
    341         $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    342     }
    343 
    344     /* translators: Password reset email subject. 1: Site name */
    345     $title = sprintf( __('[%s] Password Reset'), $blogname );
     334        $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
     335    }
     336
     337    $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n";
     338    /* translators: %s: site name */
     339    $message .= sprintf( __( 'Site Name: %s'), $site_name ) . "\r\n\r\n";
     340    /* translators: %s: user login */
     341    $message .= sprintf( __( 'Username: %s'), $user_login ) . "\r\n\r\n";
     342    $message .= __( 'If this was a mistake, just ignore this email and nothing will happen.' ) . "\r\n\r\n";
     343    $message .= __( 'To reset your password, visit the following address:' ) . "\r\n\r\n";
     344    $message .= '<' . network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . ">\r\n";
     345
     346    /* translators: Password reset email subject. %s: Site name */
     347    $title = sprintf( __( '[%s] Password Reset' ), $site_name );
    346348
    347349    /**
Note: See TracChangeset for help on using the changeset viewer.