Changeset 45712
- Timestamp:
- 08/01/2019 03:29:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r45611 r45712 1894 1894 * @since 4.6.0 The `$notify` parameter accepts 'user' for sending notification only to the user created. 1895 1895 * 1896 * @global wpdb $wpdb WordPress database object for queries.1897 * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance.1898 *1899 1896 * @param int $user_id User ID. 1900 1897 * @param null $deprecated Not used (argument deprecated). … … 1912 1909 } 1913 1910 1914 global $wpdb, $wp_hasher;1915 1911 $user = get_userdata( $user_id ); 1916 1912 … … 1972 1968 } 1973 1969 1974 // Generate something random for a password reset key. 1975 $key = wp_generate_password( 20, false ); 1976 1977 /** This action is documented in wp-login.php */ 1978 do_action( 'retrieve_password_key', $user->user_login, $key ); 1979 1980 // Now insert the key, hashed, into the DB. 1981 if ( empty( $wp_hasher ) ) { 1982 require_once ABSPATH . WPINC . '/class-phpass.php'; 1983 $wp_hasher = new PasswordHash( 8, true ); 1984 } 1985 $hashed = time() . ':' . $wp_hasher->HashPassword( $key ); 1986 $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) ); 1970 $key = get_password_reset_key( $user ); 1971 if ( is_wp_error( $key ) ) { 1972 return; 1973 } 1987 1974 1988 1975 $switched_locale = switch_to_locale( get_user_locale( $user ) );
Note: See TracChangeset
for help on using the changeset viewer.