Skip to content

Commit

Permalink
Removing deprecated PasswordEncryptor::compare() method
Browse files Browse the repository at this point in the history
Use PasswordEncryptor::check() instead
  • Loading branch information
Sean Harvey committed Nov 15, 2012
1 parent f122b10 commit 587d669
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions security/PasswordEncryptor.php
Expand Up @@ -102,22 +102,6 @@ public function salt($password, $member = null) {
return substr($generator->generateHash('sha1'), 0, 50);
}

/**
* This usually just returns a strict string comparison,
* but is necessary for {@link PasswordEncryptor_LegacyPHPHash}.
*
* @param String $hash1
* @param String $hash2
* @return boolean
*
* @deprecated 3.0 - Use PasswordEncryptor::check() instead.
*/
public function compare($hash1, $hash2) {
Deprecation::notice('3.0.0',
'PasswordEncryptor::compare() is deprecated, replaced by PasswordEncryptor::check().');
return ($hash1 === $hash2);
}

/**
* This usually just returns a strict string comparison,
* but is necessary for retain compatibility with password hashed
Expand Down Expand Up @@ -355,15 +339,6 @@ public function encrypt($password, $salt = null, $member = null) {
// letters.
return substr(base_convert($password, 16, 36), 0, 64);
}

public function compare($hash1, $hash2) {
Deprecation::notice('3.0.0',
'PasswordEncryptor::compare() is deprecated, replaced by PasswordEncryptor::check().');

// Due to flawed base_convert() floating poing precision,
// only the first 10 characters are consistently useful for comparisons.
return (substr($hash1, 0, 10) === substr($hash2, 0, 10));
}

public function check($hash, $password, $salt = null, $member = null) {
// Due to flawed base_convert() floating poing precision,
Expand Down

0 comments on commit 587d669

Please sign in to comment.