-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Aggressively use actual function parameters in php_verror
#12276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
2293ae4
4324e64
060d971
83a6868
3f0e8cf
6e88792
8e0e56b
9e866be
f1fc6bb
710eb4c
401694c
a3084cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| --TEST-- | ||
| Displaying function arguments in errors | ||
| --INI-- | ||
| error_include_args=On | ||
| --FILE-- | ||
| <?php | ||
|
|
||
| // A function that sets its own parameters in docref call, to compare | ||
| unlink('/'); | ||
|
|
||
| // Something with sensitive parameters that exists in a minimal build, | ||
| // and also doesn't set anything in the docref call. cost is set to 4 | ||
| // to keep the test fast | ||
| $flags = ["salt" => "123456789012345678901" . chr(0), "cost" => 4]; | ||
| password_hash("test", PASSWORD_BCRYPT, $flags); | ||
|
|
||
| ini_set("error_include_args", "Off"); | ||
|
|
||
| unlink('/'); | ||
| password_hash("test", PASSWORD_BCRYPT, $flags); | ||
|
|
||
| ?> | ||
| --EXPECTF-- | ||
| Warning: unlink('/'): %s in %s on line %d | ||
|
|
||
| Warning: password_hash(Object(SensitiveParameterValue), '2y', Array): The "salt" option has been ignored, since providing a custom salt is no longer supported in %s on line %d | ||
|
|
||
| Warning: unlink(/): %s in %s on line %d | ||
|
|
||
| Warning: password_hash(): The "salt" option has been ignored, since providing a custom salt is no longer supported in %s on line %d |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -611,6 +611,12 @@ ignore_repeated_source = Off | |
| ; Production Value: On | ||
| ;fatal_error_backtraces = On | ||
|
|
||
| ; This directive controls whether PHP will print the actual arguments of a | ||
| ; function upon an error. If this is off (or there was an error fetching the | ||
| ; arguments), the function providing the error may optionally provide some | ||
| ; additional information after the problem function's name. | ||
| ;error_include_args = Off | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd recommend that the default be
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In retrospect, I should have done separate production vs. development INI value votes for the RFC. I'm not sure if I can do this after the vote? |
||
|
|
||
| ;;;;;;;;;;;;;;;;; | ||
| ; Data Handling ; | ||
| ;;;;;;;;;;;;;;;;; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which call is failing? Is this that the zval type might not be an array on failure? Can you add a test case with memory exhaustion?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think backtrace may not return an array if under memory exhaustion. I'm not sure how best to test memory exhaustion cases though.