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

Check uploaded (content) files #84

Open
sr258 opened this issue Aug 30, 2019 · 2 comments
Open

Check uploaded (content) files #84

sr258 opened this issue Aug 30, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers H5P-Editor

Comments

@sr258
Copy link
Member

sr258 commented Aug 30, 2019

Files uploaded through the AJAX endpoint (images, video etc.) need to be check whether they are valid:

  • the extension must be in H5PEditorConfig.contentWhitelist
  • the file must be smaller than H5PEditorConfig.maxFileSize
  • the package it is added to must not have a greater total size than H5PEditorConfig.maxTotalSize

There are further checks in h5p-editor-php-library:h5p-editor-file.class.php:

  • check if field type & mime-type match
  • check if mime-type is allowed
    • if image (check by mime type):
      - only allow png,jpg,jpg,gif
      - read image (& get file size)
    • if audio (check by mime type): only allow mpeg, mp3, m4a, mp4, wav, x-wav, ogg
    • if video (check by mime type): only allow mp4,webm, ogg
  • check if mime-type matches extension
@JPSchellenberg
Copy link
Member

JPSchellenberg commented Aug 30, 2019

the package it is added to must have a greater total size than H5PEditorConfig.maxTotalSize

You mean the package must NOT have a greater total size than H5PEditorConfig.maxTotalSize, right?

@sr258
Copy link
Member Author

sr258 commented Aug 31, 2019

Yeah, sorry! Corrected that.

@sr258 sr258 added enhancement New feature or request good first issue Good for newcomers labels Sep 1, 2019
@sr258 sr258 added this to the Milestone 2 milestone Dec 1, 2019
@sr258 sr258 removed this from the Milestone 2 milestone Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers H5P-Editor
Projects
None yet
Development

No branches or pull requests

2 participants