-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix/only allow svg when uploading #228
Conversation
@darylldoyle thanks for the PR! Could you please fill out the PR template with description, changelog, and credits information so that we can properly review and merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this doesn't work for me, I always get the Sorry, you are not allowed to upload this file type
error message.
I think what's happening is there's an earlier mime check that fires before the wp_handle_upload_prefilter
filter and since we aren't adding the svg mime until that filter runs, things no longer work.
To test, I'm in the Media Library admin page, with the Grid View on. If I drag and drop an svg image, I get the above error.
I was curious on how our E2E tests were passing here when I couldn't get things to work. Looking into that, the |
Thanks for flagging @dkotter! I too could replicate on the media grid view. I've resolved this and added additional tests for that. I also had to allow uploads from a few additional contexts, because otherwise you could only upload SVGs from the media pages. We might want to add some additional tests for these, but I don't have time at the moment. |
Description of the Change
Updates the plugin to only add SVGs as an allowed type, when the sanitiser will be able to run on those files.
How to test the Change
Changelog Entry
Credits
Props @username, @username2, ...
Checklist: