-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
U4-9558 - Media upload whitelist #1939
Conversation
…ck list to common extension method.
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 don't think we should change the behavior for showing files unless I'm missing something. Otherwise this looks all good!
var allowedUploadFiles = mediaHelper.formatFileTypes(umbracoSettings.allowedUploadFiles); | ||
if ($scope.onlyImages) { | ||
// If whitelist provided, use just images from that | ||
if (allowedUploadFiles !== '') { |
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 understand what you're doing here but this is fundamentally different to what is currently happening - the list of imageFileTypes (which admittedly has been hijacked from it's original usage) determined what is being shown in the list. This would be a breaking change in that behavior.
Furthermore I think it would be unexpected behavior.. if you had already uploaded a bunch of gif files but they are no longer allowed to be uploaded after a configuration change, I would not expect them to suddenly now appear in the list any more.
Maybe I'm missing something in your thinking?
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.
Yes, agree with your point. I've pushed a change reverting the allowed files here when picking images.
…figured image types
Awesome, it works great, code looks good, thank you Andy!! |
As described in issue this PR allows for Umbraco settings to contain an upload file extension whitelist. If it's present, it's used to determine which files can be uploaded. If not, it reverts back to the existing black list functionality.