File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
ext/standard/tests/password Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ --TEST--
2+ Test that the password parameter is marked sensitive.
3+ --FILE--
4+ <?php
5+ try {
6+ var_dump (password_hash ("foo " ));
7+ } catch (\Throwable $ e ) {
8+ echo $ e , PHP_EOL ;
9+ }
10+ try {
11+ var_dump (password_hash ("foo " , "Invalid " ));
12+ } catch (\Throwable $ e ) {
13+ echo $ e , PHP_EOL ;
14+ }
15+ ?>
16+ --EXPECTF--
17+ ArgumentCountError: password_hash() expects at least 2 arguments, 1 given in %spassword_hash_sensitive_parameter.php:3
18+ Stack trace:
19+ #0 %spassword_hash_sensitive_parameter.php(3): password_hash(Object(SensitiveParameter))
20+ #1 {main}
21+ ValueError: password_hash(): Argument #2 ($algo) must be a valid password hashing algorithm in%spassword_hash_sensitive_parameter.php:8
22+ Stack trace:
23+ #0 %spassword_hash_sensitive_parameter.php(8): password_hash(Object(SensitiveParameter), 'Invalid')
24+ #1 {main}
You can’t perform that action at this time.
0 commit comments