Changeset 44780
- Timestamp:
- 02/28/2019 02:38:27 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r44606 r44780 2321 2321 } 2322 2322 2323 $row = $wpdb->get_row( $wpdb->prepare( "SELECT ID, user_activation_key FROM $wpdb->users WHERE user_login = %s", $login ) ); 2324 if ( ! $row ) { 2323 $user = get_user_by( 'login', $login ); 2324 2325 if ( ! $user ) { 2325 2326 return new WP_Error( 'invalid_key', __( 'Invalid key' ) ); 2326 2327 } … … 2340 2341 $expiration_duration = apply_filters( 'password_reset_expiration', DAY_IN_SECONDS ); 2341 2342 2342 if ( false !== strpos( $ row->user_activation_key, ':' ) ) {2343 list( $pass_request_time, $pass_key ) = explode( ':', $ row->user_activation_key, 2 );2343 if ( false !== strpos( $user->user_activation_key, ':' ) ) { 2344 list( $pass_request_time, $pass_key ) = explode( ':', $user->user_activation_key, 2 ); 2344 2345 $expiration_time = $pass_request_time + $expiration_duration; 2345 2346 } else { 2346 $pass_key = $ row->user_activation_key;2347 $pass_key = $user->user_activation_key; 2347 2348 $expiration_time = false; 2348 2349 } … … 2355 2356 2356 2357 if ( $hash_is_correct && $expiration_time && time() < $expiration_time ) { 2357 return get_userdata( $row->ID );2358 return $user; 2358 2359 } elseif ( $hash_is_correct && $expiration_time ) { 2359 2360 // Key has an expiration time that's passed … … 2361 2362 } 2362 2363 2363 if ( hash_equals( $ row->user_activation_key, $key ) || ( $hash_is_correct && ! $expiration_time ) ) {2364 if ( hash_equals( $user->user_activation_key, $key ) || ( $hash_is_correct && ! $expiration_time ) ) { 2364 2365 $return = new WP_Error( 'expired_key', __( 'Invalid key' ) ); 2365 $user_id = $ row->ID;2366 $user_id = $user->ID; 2366 2367 2367 2368 /**
Note: See TracChangeset
for help on using the changeset viewer.