-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Test calling and disallowing a function when its disallowedParam
is array|string|null
#165
Merged
Conversation
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
mad-briller
force-pushed
the
fix-array-param
branch
from
January 20, 2023 12:12
f2f6d99
to
f21e1fc
Compare
spaze
requested changes
Jan 20, 2023
Hi, thanks for the PR. This is unfortunately a bit more difficult to handle as some users may disallow params with arrays and this change would miss such params. |
…red disallowed when using disallowParams.
spaze
changed the title
Fixed issue where calling a function with an array was always considered disallowed when using disallowParams
Test calling and disallowing a function when its Mar 19, 2023
disallowedParam
is array|string|null
spaze
approved these changes
Mar 19, 2023
spaze
added a commit
that referenced
this pull request
Mar 19, 2023
A non-scalar param config value would throw `ShouldNotHappenException`. This may change in the future. Ref #165
this has fixed it! thanks for getting it over the line and sorry i couldn't take it further, i had a few tries but couldn't make much progress and ran out of time |
Thanks and no problem! :-) I'll publish a release soon. |
Released in 2.12.1. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to disallow the usage of a particular configuration key in Laravel, this false positive was discovered.
the Laravel
config()
helper can take a string or array as it's first argument, strings are used to read and arrays are used to update the configuration.when a
disallowParams
was set to disallow the use of a constant string as the first argument, calls that provided an array were falsey flagged as disallowed.this rectifies that issue, however i'm not convinced this is the best way to go about this due to unfamiliarity with this codebase, but it resolves the cases i had to hand, so feel free to let me know if there's a better way
thanks for your time