Privacy: Add requester IP to password reset emails.

Props garrett-eclipse, bridgetwillard, isharis, ocean90.
Fixes #43856.


git-svn-id: https://develop.svn.wordpress.org/trunk@49255 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2020-10-20 20:01:04 +00:00
parent 0e0781edc0
commit 27e7c718f6
2 changed files with 14 additions and 2 deletions

View File

@ -584,6 +584,9 @@ final class WP_Privacy_Policy_Content {
$strings[] = '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
}
/* translators: Default privacy policy text. */
$strings[] = '<p>' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '</p>';
/* translators: Default privacy policy heading. */
$strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';

View File

@ -432,9 +432,18 @@ function retrieve_password() {
$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 .= __( 'If this was a mistake, 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";
$message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . "\r\n\r\n";
$requestor_ip = $_SERVER['REMOTE_ADDR'];
if ( $requestor_ip ) {
$message .= sprintf(
/* translators: %s: IP address of password reset requestor. */
__( 'This password reset request originated from the IP address %s.' ),
$requestor_ip
) . "\r\n";
}
/* translators: Password reset notification email subject. %s: Site title. */
$title = sprintf( __( '[%s] Password Reset' ), $site_name );