-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1261 from sjinks/max_pass_len
Ability to restrict the maximum password length for Phalcon\Security::checkHash()
- Loading branch information
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Ability to restrict the maximum password length for Phalcon\Security::checkHash() - https://github.com/phalcon/cphalcon/pull/1261 | ||
--SKIPIF-- | ||
<?php include('skipif.inc'); ?> | ||
--FILE-- | ||
<?php | ||
$s = new \Phalcon\Security(); | ||
$hash = $s->hash('password', 10); | ||
echo var_export((bool)$s->checkHash('password', $hash), 0), PHP_EOL; | ||
echo var_export((bool)$s->checkHash('password', $hash, 0), 0), PHP_EOL; | ||
echo var_export((bool)$s->checkHash('password', $hash, 8), 0), PHP_EOL; | ||
echo var_export((bool)$s->checkHash('password', $hash, 7), 0), PHP_EOL; | ||
?> | ||
--EXPECT-- | ||
true | ||
true | ||
true | ||
false |