Changeset 45716
- Timestamp:
- 08/01/2019 07:18:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r45715 r45716 2372 2372 } 2373 2373 2374 $row = $wpdb->get_row( $wpdb->prepare( "SELECT ID, user_activation_key FROM $wpdb->users WHERE user_login = %s", $login ) ); 2375 if ( ! $row ) { 2374 $user = get_user_by( 'login', $login ); 2375 2376 if ( ! $user ) { 2376 2377 return new WP_Error( 'invalid_key', __( 'Invalid key.' ) ); 2377 2378 } … … 2391 2392 $expiration_duration = apply_filters( 'password_reset_expiration', DAY_IN_SECONDS ); 2392 2393 2393 if ( false !== strpos( $ row->user_activation_key, ':' ) ) {2394 list( $pass_request_time, $pass_key ) = explode( ':', $ row->user_activation_key, 2 );2394 if ( false !== strpos( $user->user_activation_key, ':' ) ) { 2395 list( $pass_request_time, $pass_key ) = explode( ':', $user->user_activation_key, 2 ); 2395 2396 $expiration_time = $pass_request_time + $expiration_duration; 2396 2397 } else { 2397 $pass_key = $ row->user_activation_key;2398 $pass_key = $user->user_activation_key; 2398 2399 $expiration_time = false; 2399 2400 } … … 2406 2407 2407 2408 if ( $hash_is_correct && $expiration_time && time() < $expiration_time ) { 2408 return get_userdata( $row->ID );2409 return $user; 2409 2410 } elseif ( $hash_is_correct && $expiration_time ) { 2410 2411 // Key has an expiration time that's passed … … 2412 2413 } 2413 2414 2414 if ( hash_equals( $ row->user_activation_key, $key ) || ( $hash_is_correct && ! $expiration_time ) ) {2415 if ( hash_equals( $user->user_activation_key, $key ) || ( $hash_is_correct && ! $expiration_time ) ) { 2415 2416 $return = new WP_Error( 'expired_key', __( 'Invalid key.' ) ); 2416 $user_id = $ row->ID;2417 $user_id = $user->ID; 2417 2418 2418 2419 /**
Note: See TracChangeset
for help on using the changeset viewer.