Privacy: Add requester IP to password reset emails.

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

Built from https://develop.svn.wordpress.org/trunk@49255


git-svn-id: http://core.svn.wordpress.org/trunk@49017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2020-10-20 20:03:08 +00:00
parent 9ab2f1ae3e
commit 5b4d643d60
3 changed files with 15 additions and 3 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

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.6-alpha-49254';
$wp_version = '5.6-alpha-49255';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

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 );