H5P-Editorenhancementgood first issue
Description
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