Opened 3 years ago
Closed 8 months ago
#6 closed defect (fixed)
MIME type regex too restrictive
| Reported by: | change500 | Owned by: | niallkennedy |
|---|---|---|---|
| Priority: | minor | Component: | wordpresscom-video-server |
| Keywords: | mime | Cc: |
Description
The transcoder does not accept uploads unless the mime-type starts with "video" - however, some browsers, such as Firefox, set the mime-type to "application" for m4v and mp4 files.
Video-lib.php around line 110
Existing
if ( false === strpos( get_post_mime_type( $post_id ), 'video/' ) )
return false;
Updated
if ( false === strpos( get_post_mime_type( $post_id ), 'video/' ) &&
false === strpos( get_post_mime_type( $post_id ), 'application/' ))
return false;
around line 350 video-lib.php
Existing
function is_video( $post_id ) {
return ( 0 === strpos( get_post_mime_type( $post_id ), 'video/' ) );
}
Updated
function is_video( $post_id ) {
0 !== strpos( get_post_mime_type( $post_id ), 'application/' ) );
}
Change History (1)
comment:1 Changed 8 months ago by pento
- Resolution set to fixed
- Status changed from new to closed

WPCOM VideoPress? uses exiftool to determine if the file is a video, this is no longer an issue. Fix will be in the next server release.