diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2014-06-02 10:14:26 +0200 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2014-06-02 10:14:26 +0200 |
| commit | ac311e1b39f891ba3c137f6203981c491639bec3 (patch) | |
| tree | 43e76978dcbc89aec7ad6a65d2f08cadc62772e6 /phpBB/phpbb/passwords/driver/sha1_smf.php | |
| parent | 94b2b64ca199f3db66818c3830c96ea9ff7eeff9 (diff) | |
| download | forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar.gz forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar.bz2 forums-ac311e1b39f891ba3c137f6203981c491639bec3.tar.xz forums-ac311e1b39f891ba3c137f6203981c491639bec3.zip | |
[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
Diffstat (limited to 'phpBB/phpbb/passwords/driver/sha1_smf.php')
| -rw-r--r-- | phpBB/phpbb/passwords/driver/sha1_smf.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/phpBB/phpbb/passwords/driver/sha1_smf.php b/phpBB/phpbb/passwords/driver/sha1_smf.php index 6cc0841f4d..3e3322d77f 100644 --- a/phpBB/phpbb/passwords/driver/sha1_smf.php +++ b/phpBB/phpbb/passwords/driver/sha1_smf.php @@ -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; } } |
