Description
MediaUploadModal supports '*' as a wildcard in allowedTypes but passes it as-is to uploadMedia(). Inside, validateMimeType has no handling for '*' — it checks file.type.startsWith('*/') which is never true, so every upload fails with "Sorry, this file type is not supported here." instead of being allowed through.
Step-by-step reproduction instructions
- Enable the Data Views: new media modal experiment under Gutenberg → Experiments
- Install the test plugin: https://github.com/dinhtungdu/verify-wildcard-upload
- Add the Wildcard Upload Test block to any post
- Open the Inspector → "Wildcard Upload (allowedTypes=[*])" panel
- Click "Select / Upload any files" and upload any file type (PNG, PDF, .xyz, etc.)
- Observe the error: "
filename: Sorry, this file type is not supported here."
Screenshots, screen recording, code snippet
Environment info
- Gutenberg trunk
- Affects both
@wordpress/media-utils and @wordpress/upload-media packages
Description
MediaUploadModalsupports'*'as a wildcard inallowedTypesbut passes it as-is touploadMedia(). Inside,validateMimeTypehas no handling for'*'— it checksfile.type.startsWith('*/')which is never true, so every upload fails with "Sorry, this file type is not supported here." instead of being allowed through.Step-by-step reproduction instructions
filename: Sorry, this file type is not supported here."Screenshots, screen recording, code snippet
Environment info
@wordpress/media-utilsand@wordpress/upload-mediapackages