Code Duplication    Length = 4-5 lines in 5 locations

src/wp-includes/pluggable.php 3 locations

@@ 1812-1815 (lines=4) @@
1809
	do_action( 'retrieve_password_key', $user->user_login, $key );
1810
1811
	// Now insert the key, hashed, into the DB.
1812
	if ( empty( $wp_hasher ) ) {
1813
		require_once ABSPATH . WPINC . '/class-phpass.php';
1814
		$wp_hasher = new PasswordHash( 8, true );
1815
	}
1816
	$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
1817
	$wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
1818
@@ 2093-2097 (lines=5) @@
2090
function wp_hash_password($password) {
2091
	global $wp_hasher;
2092
2093
	if ( empty($wp_hasher) ) {
2094
		require_once( ABSPATH . WPINC . '/class-phpass.php');
2095
		// By default, use the portable hash from phpass
2096
		$wp_hasher = new PasswordHash(8, true);
2097
	}
2098
2099
	return $wp_hasher->HashPassword( trim( $password ) );
2100
}
@@ 2153-2157 (lines=5) @@
2150
2151
	// If the stored hash is longer than an MD5, presume the
2152
	// new style phpass portable hash.
2153
	if ( empty($wp_hasher) ) {
2154
		require_once( ABSPATH . WPINC . '/class-phpass.php');
2155
		// By default, use the portable hash from phpass
2156
		$wp_hasher = new PasswordHash(8, true);
2157
	}
2158
2159
	$check = $wp_hasher->CheckPassword($password, $hash);
2160

src/wp-includes/user.php 2 locations

@@ 2133-2136 (lines=4) @@
2130
	do_action( 'retrieve_password_key', $user->user_login, $key );
2131
2132
	// Now insert the key, hashed, into the DB.
2133
	if ( empty( $wp_hasher ) ) {
2134
		require_once ABSPATH . WPINC . '/class-phpass.php';
2135
		$wp_hasher = new PasswordHash( 8, true );
2136
	}
2137
	$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
2138
	$key_saved = $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
2139
	if ( false === $key_saved ) {
@@ 2178-2181 (lines=4) @@
2175
	if ( ! $row )
2176
		return new WP_Error('invalid_key', __('Invalid key'));
2177
2178
	if ( empty( $wp_hasher ) ) {
2179
		require_once ABSPATH . WPINC . '/class-phpass.php';
2180
		$wp_hasher = new PasswordHash( 8, true );
2181
	}
2182
2183
	/**
2184
	 * Filters the expiration time of password reset keys.