-
Notifications
You must be signed in to change notification settings - Fork 8k
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
6a4e5a2
48d9cd2
487e059
39ae287
187e0c3
7830f31
15ed44f
7434069
7da8ebd
b1d3f50
41d448e
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,28 @@ | ||
| --TEST-- | ||
| Displaying function arguments in errors | ||
| --INI-- | ||
| display_error_function_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 | ||
| // XXX: May be better to provide a new zend_test func? | ||
| password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . chr(0))); | ||
|
|
||
| ini_set("display_error_function_args", "Off"); | ||
|
|
||
| unlink('/'); | ||
| password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . chr(0))); | ||
|
|
||
| ?> | ||
| --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,15 @@ 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 disabled (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. | ||
| ; Default Value: Off | ||
| ; Development Value: On | ||
| ; Production Value: On | ||
| display_error_function_args = On | ||
|
Comment on lines
+618
to
+621
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. Related to Daniel's comment: Please avoid further INIs where the builtin default differs from the recommended “production default”.
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. Relatedly, we should probably finally drop
Contributor
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. Do you mean
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.
Yes, thank you.
Contributor
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. Going back to the original comment of avoiding defaults which are different from production recommendations: Is there a consensus that the default should be production settings? Because some of the main settings like I can see arguments for both and don't have a strong opinion, I'm just pointing out that I'm unaware of a clear decision. |
||
|
|
||
| ;;;;;;;;;;;;;;;;; | ||
| ; 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.
I suggest taking a look at https://wiki.php.net/rfc/error_backtraces_v2 and its discussion - you can have the default be true generally, and then false for tests