File upload improvements#1770
Merged
ArtOfCode- merged 11 commits intodevelopfrom Aug 10, 2025
Merged
Conversation
ArtOfCode-
approved these changes
Aug 10, 2025
|
|
||
| # Is the setting boolean-valued? | ||
| # @return [Boolena] check result | ||
| # @return [Boolean] check result |
Member
There was a problem hiding this comment.
I, for one, think Boolena was a perfectly fitting alternative. Poor Boolena.
Member
Author
There was a problem hiding this comment.
Too bad Boolena will be busy on calls from now on and never return...
This file contains hidden or 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
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.
closes #1769
This PR:
fixes inability to upload .jpg images due to a change in
web_image_content_typesthat we used to rely on;removes the check for "submitted extension" completely as we already check the actual type of the file and don't need the submitted extension for anything (not to mention that extension checking is brittle and should be avoided in the first place. Case in point - the issue at hand);
adds a new
optionscolumn (YAML array encoded) for site settings, as well as a matchingarraytype;a new global site setting in the "Site Details" category -
AllowedUploadTypesthat allows admins to choose allowed file types (important note: to avoid scope creep & unforeseen consequences, the setting can only be restricted for now but can easily be extended later):I did not bother with human-friendly labels at this point as changing the setting itself requires expertise, and adding them in our current setup is a bit burdensome, but if anyone thinks it'll be beneficial to do so now, happy to oblige. The setting's description could also use some work - suggestions welcome (quesiton for @ArtOfCode-: do we have any reverse proxy or AWS settings / policies that admins need to be made aware of when editing the setting?).
Note for reviewers: there's both a new seed and a new migration. Don't forget to run & rollback both when switching between branches. There's also a new gem (
mime-types), so remember to install it first.