Code Duplication    Length = 4-5 lines in 5 locations

wp-includes/pluggable.php 3 locations

@@ 1741-1744 (lines=4) @@
1738
	do_action( 'retrieve_password_key', $user->user_login, $key );
1739
1740
	// Now insert the key, hashed, into the DB.
1741
	if ( empty( $wp_hasher ) ) {
1742
		require_once ABSPATH . WPINC . '/class-phpass.php';
1743
		$wp_hasher = new PasswordHash( 8, true );
1744
	}
1745
	$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
1746
	$wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
1747
@@ 2016-2020 (lines=5) @@
2013
function wp_hash_password($password) {
2014
	global $wp_hasher;
2015
2016
	if ( empty($wp_hasher) ) {
2017
		require_once( ABSPATH . WPINC . '/class-phpass.php');
2018
		// By default, use the portable hash from phpass
2019
		$wp_hasher = new PasswordHash(8, true);
2020
	}
2021
2022
	return $wp_hasher->HashPassword( trim( $password ) );
2023
}
@@ 2076-2080 (lines=5) @@
2073
2074
	// If the stored hash is longer than an MD5, presume the
2075
	// new style phpass portable hash.
2076
	if ( empty($wp_hasher) ) {
2077
		require_once( ABSPATH . WPINC . '/class-phpass.php');
2078
		// By default, use the portable hash from phpass
2079
		$wp_hasher = new PasswordHash(8, true);
2080
	}
2081
2082
	$check = $wp_hasher->CheckPassword($password, $hash);
2083

wp-includes/user.php 2 locations

@@ 2097-2100 (lines=4) @@
2094
	do_action( 'retrieve_password_key', $user->user_login, $key );
2095
2096
	// Now insert the key, hashed, into the DB.
2097
	if ( empty( $wp_hasher ) ) {
2098
		require_once ABSPATH . WPINC . '/class-phpass.php';
2099
		$wp_hasher = new PasswordHash( 8, true );
2100
	}
2101
	$hashed = time() . ':' . $wp_hasher->HashPassword( $key );
2102
	$key_saved = $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user->user_login ) );
2103
	if ( false === $key_saved ) {
@@ 2142-2145 (lines=4) @@
2139
	if ( ! $row )
2140
		return new WP_Error('invalid_key', __('Invalid key'));
2141
2142
	if ( empty( $wp_hasher ) ) {
2143
		require_once ABSPATH . WPINC . '/class-phpass.php';
2144
		$wp_hasher = new PasswordHash( 8, true );
2145
	}
2146
2147
	/**
2148
	 * Filters the expiration time of password reset keys.