Make WordPress Core

Changeset 49255


Ignore:
Timestamp:
10/20/2020 08:01:04 PM (4 years ago)
Author:
helen
Message:

Privacy: Add requester IP to password reset emails.

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

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php

    r48836 r49255  
    585585        }
    586586
     587        /* translators: Default privacy policy text. */
     588        $strings[] = '<p>' . $suggested_text . __( 'If you request a password reset, your IP address will be included in the reset email.' ) . '</p>';
     589
    587590        /* translators: Default privacy policy heading. */
    588591        $strings[] = '<h2>' . __( 'How long we retain your data' ) . '</h2>';
  • trunk/src/wp-login.php

    r49215 r49255  
    433433    /* translators: %s: User login. */
    434434    $message .= sprintf( __( 'Username: %s' ), $user_login ) . "\r\n\r\n";
    435     $message .= __( 'If this was a mistake, just ignore this email and nothing will happen.' ) . "\r\n\r\n";
     435    $message .= __( 'If this was a mistake, ignore this email and nothing will happen.' ) . "\r\n\r\n";
    436436    $message .= __( 'To reset your password, visit the following address:' ) . "\r\n\r\n";
    437     $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . "\r\n";
     437    $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user_login ), 'login' ) . "\r\n\r\n";
     438
     439    $requestor_ip = $_SERVER['REMOTE_ADDR'];
     440    if ( $requestor_ip ) {
     441        $message .= sprintf(
     442            /* translators: %s: IP address of password reset requestor. */
     443            __( 'This password reset request originated from the IP address %s.' ),
     444            $requestor_ip
     445        ) . "\r\n";
     446    }
    438447
    439448    /* translators: Password reset notification email subject. %s: Site title. */
Note: See TracChangeset for help on using the changeset viewer.