WordPress.org

Make WordPress Core

Ticket #22328: wp-login.2.diff

File wp-login.2.diff, 1.6 KB (added by ejdanderson, 3 years ago)
  • wp-login.php

     
    228228                // Now insert the new md5 key into the db 
    229229                $wpdb->update($wpdb->users, array('user_activation_key' => $key), array('user_login' => $user_login)); 
    230230        } 
     231        $reset_url = network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login'); 
     232 
    231233        $message = __('Someone requested that the password be reset for the following account:') . "\r\n\r\n"; 
    232234        $message .= network_home_url( '/' ) . "\r\n\r\n"; 
    233235        $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; 
    234236        $message .= __('If this was a mistake, just ignore this email and nothing will happen.') . "\r\n\r\n"; 
    235237        $message .= __('To reset your password, visit the following address:') . "\r\n\r\n"; 
    236         $message .= '<' . network_site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . ">\r\n"; 
     238        $message .= '<' . $reset_url . ">\r\n"; 
    237239 
    238240        if ( is_multisite() ) 
    239241                $blogname = $GLOBALS['current_site']->site_name; 
     
    245247        $title = sprintf( __('[%s] Password Reset'), $blogname ); 
    246248 
    247249        $title = apply_filters('retrieve_password_title', $title); 
    248         $message = apply_filters('retrieve_password_message', $message, $key); 
     250        $message = apply_filters('retrieve_password_message', $message, $key, $reset_url); 
    249251 
    250252        if ( $message && !wp_mail($user_email, $title, $message) ) 
    251253                wp_die( __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') );