Skip to content
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

Merged
merged 5 commits into from
May 20, 2017
Merged

Conversation

AndyButland
Copy link
Contributor

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.

Copy link
Member

@nul800sebastiaan nul800sebastiaan left a 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 !== '') {
Copy link
Member

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?

Copy link
Contributor Author

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.

@nul800sebastiaan nul800sebastiaan changed the base branch from dev-v7.6 to dev-v7 May 20, 2017 09:48
@nul800sebastiaan nul800sebastiaan merged commit eb35791 into umbraco:dev-v7 May 20, 2017
@nul800sebastiaan
Copy link
Member

Awesome, it works great, code looks good, thank you Andy!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants