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:
Andreas Fischer 2014-05-08 13:02:48 +02:00
commit 8ede209ea3

View file

@ -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'];