-
Notifications
You must be signed in to change notification settings - Fork 2k
fix: filter except empty #7823
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
fix: filter except empty #7823
Conversation
neznaika0
left a comment
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.
Thanks
|
Strictly speaking, this may be a breaking change. However, it does not appear that any developer would want to disable the filter by specifying an empty array or empty string. If there is, it would be a case of specifying them by mistake and not realizing that the filter is disabled. |
I agree that this should not be the behavior. ['except' => [
'*',
]];
// or
['except' => '*' ]; |
|
Ha, it's wrong, but it will work. To exclude everyone, you need to remove the filter. There is no logic to enable the filter and disable it by rules |
I was considering the implementation with the Settings package. It looks good to me. |
This behavior is unexpected and not good for security. If a dev removes all items in `except` key, the filter is disabled. Now "except empty" means "except nothing".
8ea1a4a to
b6a3c7d
Compare
The URI path '' means the baseURL. So ['except' => ''] should mean that except for the baseURL only.
c223a28 to
79aaefb
Compare
|
The URI string I changed that way. |
7564d92 to
ef08813
Compare
ef08813 to
e510da9
Compare
MGatner
left a comment
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 agree this is a good fix for a common "gotcha"
Description
See #7822 (comment)
This PR changes the behavior:
['except' => []]means to exclude nothing.['except' => '']means to exclude baseURL only.''means the URI path for the baseURL.uri_string()returns''.['except' => []]or['except' => '']means "except all" in the current code.This behavior is unexpected, and not good for security.
If a dev comments out all items in
exceptkey accidentally, the filter will be disabled.Checklist: