From 649eb34d2ac030939fea6878e924b5accdcbf647 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 23 Sep 2017 11:44:46 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@41578 git-svn-id: http://core.svn.wordpress.org/trunk@41411 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-login.php | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index f45542a541..684d87da86 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41577'; +$wp_version = '4.9-alpha-41578'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index 4670b171b3..e2376651d1 100644 --- a/wp-login.php +++ b/wp-login.php @@ -324,25 +324,27 @@ function retrieve_password() { return $key; } - $message = __('Someone has requested a password reset for the following account:') . "\r\n\r\n"; - $message .= network_home_url( '/' ) . "\r\n\r\n"; - $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; - $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; - $message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; - $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; - if ( is_multisite() ) { - $blogname = get_network()->site_name; + $site_name = get_network()->site_name; } else { /* * The blogname option is escaped with esc_html on the way into the database * in sanitize_option we want to reverse this for the plain text arena of emails. */ - $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); + $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); } - /* translators: Password reset email subject. 1: Site name */ - $title = sprintf( __('[%s] Password Reset'), $blogname ); + $message = __( 'Someone has requested a password reset for the following account:' ) . "\r\n\r\n"; + /* translators: %s: site name */ + $message .= sprintf( __( 'Site Name: %s'), $site_name ) . "\r\n\r\n"; + /* translators: %s: user login */ + $message .= sprintf( __( 'Username: %s'), $user_login ) . "\r\n\r\n"; + $message .= __( 'If this was a mistake, just ignore this email and nothing will happen.' ) . "\r\n\r\n"; + $message .= __( 'To reset your password, visit the following address:' ) . "\r\n\r\n"; + $message .= '<' . network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . ">\r\n"; + + /* translators: Password reset email subject. %s: Site name */ + $title = sprintf( __( '[%s] Password Reset' ), $site_name ); /** * Filters the subject of the password reset email.