WordPress.org

Make WordPress Core

Ticket #10589: email.diff

File email.diff, 668 bytes (added by Denis-de-Bernardy, 6 years ago)
  • wp-login.php

     
    193193        if ( empty($login) || !is_string($login) ) 
    194194                return new WP_Error('invalid_key', __('Invalid key')); 
    195195 
    196         $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND user_login = %s", $key, $login)); 
     196        $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE user_activation_key = %s AND ( user_login = %s OR user_email = %s )", $key, $login, $login)); 
    197197        if ( empty( $user ) ) 
    198198                return new WP_Error('invalid_key', __('Invalid key')); 
    199199