Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#45622 closed defect (bug) (duplicate)

VTT Mime Type fails upload

Reported by: birgire's profile birgire Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.0.1
Component: Upload Keywords: has-patch
Focuses: Cc:

Description

The text/vtt is an allowed mime type but doesn't match the text/plain from the $real_mime in wp_check_filetype_and_ext() and after 5.0.1 that function returns:

Array ( [ext] => [type] => [proper_filename] => )

but did return before:

Array ( [ext] => vtt [type] => text/vtt [proper_filename] => )

This was reported by Prast here.

Similar has been reported for CSV in #45615

I suspect the same might be true for some of the other supported text formats:

'csv' => 'text/csv',
'tsv' => 'text/tab-separated-values',
'ics' => 'text/calendar',
'rtx' => 'text/richtext',
'css' => 'text/css',
'htm|html' => 'text/html',
'vtt' => 'text/vtt',

Attachments (2)

45622.diff (519 bytes) - added by birgire 6 years ago.
test.vtt (1.2 KB) - added by birgire 6 years ago.
Sample file from https://w3c.github.io/webvtt/#introduction-caption

Download all attachments as: .zip

Change History (6)

@birgire
6 years ago

#1 @tellyworth
6 years ago

Thanks for the report - yes I believe you're right about at least some of those other formats also. There are further complications as well. I like your approach of adding an extra entry to the wp_get_mime_types array, that might help with some of the other issues. I'm working on testing some variations.

#2 @SergeyBiryukov
6 years ago

  • Component changed from Filesystem API to Upload
  • Milestone changed from Awaiting Review to 5.0.2

#3 @pento
6 years ago

  • Milestone changed from 5.0.2 to 5.0.3

#4 @joemcgill
6 years ago

  • Milestone 5.0.3 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

To keep this and related conversations in one place, I'm going to close this in favor of #45615.

Note: See TracTickets for help on using tickets.