-
Notifications
You must be signed in to change notification settings - Fork 4
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
Pull in latest changes from 10-0-stable #164
Merged
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
Member
mvz
commented
Oct 13, 2024
- Limit accepted parameters for Sidebar update in Admin
- Use known set of allowed attributes when autosaving an Article
- Permit only valid settings keys when updating blog settings
- Use default describe blocks for Admin::NotesController specs
- Limit assigned attributes when creating and updating Notes
- Limit allowed SEO settings params
Each sidebar generates a form containing just the fields defined in sidebar.fields. So it is not necessary, and also unsafe, to permit just any parameter. Instead, permit only the defined fields.
Limit accepted parameters for Sidebar update in Admin
The attributes of an Article are known, so there is no need to permit all parameters. Since it is also unsafe, replace it with the already known set of good parameters defined in #update_params.
Use known set of allowed attributes when autosaving an Article
The settings controller is only for updating blog settings. Instead of permitting all parameters, which is unsafe, limit permitted parameters to those that are actually blog settings.
Permit only valid settings keys when updating blog settings
Using #permit! is unsafe and not necessary, since we have a fixed set of attributes used in the notes form. Use #permit with a list of attribute names instead.
Limit assigned attributes when creating and updating Notes
This limits the set of parameters in the Admin::SeoController to the set of valid blog settings, similar to AdminSettingsController. In addition, it allows the extra :custom_permalink key to facilitate the options plus text field construction in the SEO settings form. This eliminates the use of the unsafe #permit! method.
Limit allowed SEO settings params
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.