-
Notifications
You must be signed in to change notification settings - Fork 8
The file types upload are not restricted according to the Widget type #128
Comments
To clarify: this is during the upload flow. The media browser does successfully restrict the file types, but the upload UI currently is not. |
Is this fixable? |
I suppose we could do some extension testing in the selection callback to ensure we have a valid extension per the widget. Kind of feels like the media modal should prevent this though. |
There should be a parameter to pass to the upload state to restrict the type. |
Hummm. This seems like it may actually be a core bug. For example, if you go into edit a post, and you open the media modal to select a featured image. From this screen, you can go to upload a video and then select it. That shouldn't be possible. |
FYI, there's a related ticket: |
I can see the full list of MIME types when I look at |
I'm not the only one to ask the question: http://stackoverflow.com/questions/38400352/plupload-change-mime-type-filter-after-init |
Looks like there is a bug in Plupload affecting the ability to change the file filter after init: moxiecode/plupload#1339 |
I've been digging into this issue a bit but haven't had time to code a solution yet. However, thought it might help to leave some initial thoughts. All of the supported mime types get passed to plupload via My current idea would be to try extending the wp.media.controller.Library during state creation so you could add a mime type check on the upload callback that happens here. Regardless, I don't see this as a blocker for merge, since the same issue exists currently any time media frame is created. |
It's possible to set an image to video/audio widget etc. Will be displayed as links / broken image.
The text was updated successfully, but these errors were encountered: