Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
56 | public function check($password, $hash) |
||
57 | { |
||
58 | $out = false; |
||
59 | // compare to includes/functions.inc.php is_pw_correct() mlf 2.3 |
||
60 | $saltedHash = substr($hash, 0, 40); |
||
61 | $salt = substr($hash, 40, 10); |
||
62 | if (sha1($password . $salt) == $saltedHash) : |
||
63 | $out = true; |
||
64 | endif; |
||
65 | |||
66 | return $out; |
||
67 | } |
||
69 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: