Merge pull request #8493 from owncloud/we-certainly-don't-want-type-juggling-on-that
Use strict type comparison * owncloud/we-certainly-don't-want-type-juggling-on-that: Use strict type comparison
This commit is contained in:
commit
8ede209ea3
1 changed files with 2 additions and 2 deletions
|
@ -183,14 +183,14 @@ class OC_User_Database extends OC_User_Backend {
|
|||
$row = $result->fetchRow();
|
||||
if ($row) {
|
||||
$storedHash = $row['password'];
|
||||
if ($storedHash[0] == '$') { //the new phpass based hashing
|
||||
if ($storedHash[0] === '$') { //the new phpass based hashing
|
||||
$hasher = $this->getHasher();
|
||||
if ($hasher->CheckPassword($password . OC_Config::getValue('passwordsalt', ''), $storedHash)) {
|
||||
return $row['uid'];
|
||||
}
|
||||
|
||||
//old sha1 based hashing
|
||||
} elseif (sha1($password) == $storedHash) {
|
||||
} elseif (sha1($password) === $storedHash) {
|
||||
//upgrade to new hashing
|
||||
$this->setPassword($row['uid'], $password);
|
||||
return $row['uid'];
|
||||
|
|
Loading…
Reference in a new issue