1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/12352] Do not check hashes that don't have the necessary length

This should significantly reduce the time spent on checking hashes of
passwords that should be converted.

PHPBB3-12352
This commit is contained in:
Marc Alexander
2014-06-02 10:14:26 +02:00
parent 94b2b64ca1
commit ac311e1b39
7 changed files with 7 additions and 7 deletions

View File

@@ -46,6 +46,6 @@ class sha1_smf extends base
*/
public function check($password, $hash, $user_row = array())
{
return $hash === $this->hash($password, $user_row);
return (strlen($hash) == 40) ? $hash === $this->hash($password, $user_row) : false;
}
}