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

Add fileExtension + mimetypes check on JS side #17

Merged

Conversation

tifabien
Copy link
Contributor

@tifabien tifabien commented Jul 5, 2018

This is a first fix of fileExtension checking issue raised in #16

Before merging this one, we need to get the sonata-project/SonataMediaBundle#1451 merged first.

@codecov
Copy link

codecov bot commented Jul 5, 2018

Codecov Report

Merging #17 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             master    #17   +/-   ##
=======================================
  Coverage       100%   100%           
  Complexity       13     13           
=======================================
  Files             7      7           
  Lines            33     33           
=======================================
  Hits             33     33

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a7b0304...6c19bdf. Read the comment docs.

@@ -39,6 +39,8 @@
$('div.{{ form.vars.id }}').dmUploader({
url: '{{ form.vars.action }}',
maxFileSize: 30000000000,
extFilter: {{ provider.allowedExtensions|json_encode|raw }},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a default here, too if not set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried and it seems not necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way we could get errors when the provider injected is not an instance of FileProvider. I'll add a check whether methods are defined.

@silasjoisten silasjoisten merged commit a748137 into silasjoisten:master Jul 8, 2018
@tifabien
Copy link
Contributor Author

tifabien commented Jul 8, 2018

Please note that the composer.json file needs to be updated before you tag a new version. 3.15 of the mediabundle is required.

@silasjoisten
Copy link
Owner

i will release first if the issue is fully done.

@tifabien tifabien deleted the add-js-file-extension-check branch January 21, 2019 10:16
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.

3 participants