Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42225 closed enhancement (fixed)

Whitelist Flac Files

Reported by: blobfolio's profile blobfolio Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.9.2 Priority: normal
Severity: normal Version:
Component: Media Keywords: has-patch
Focuses: Cc:

Description

[Flac](https://en.wikipedia.org/wiki/FLAC) is a popular, lossless audio compression format. It is natively supported by Chrome and Firefox, and support is also due to land in Edge 16. (See: https://caniuse.com/#search=flac)

I do not see any reason to prevent users from uploading media of this type by default.

Attachments (8)

42225.diff (440 bytes) - added by blobfolio 7 years ago.
Add flac to the default wp_get_mime_types() list.
42225.2.diff (1.9 KB) - added by blobfolio 7 years ago.
Add flac to ext2type and wp_audio_extensions defaults.
42225.3.diff (1.9 KB) - added by blobfolio 7 years ago.
Just a refresh built against the current source.
flac-frontend.png (20.9 KB) - added by blobfolio 7 years ago.
Picture showing embedded Flac media
42225.4.diff (2.0 KB) - added by blobfolio 7 years ago.
Another refresh. :)
42225.5.diff (2.6 KB) - added by blobfolio 7 years ago.
Add unit test.
small-audio.flac (28.6 KB) - added by blobfolio 7 years ago.
File for unit tests, place in tests/phpunit/data/uploads/
42225.6.diff (2.6 KB) - added by blobfolio 7 years ago.
Move unit test to "Test a few additional file types on single sites." block; seems more appropriate.

Download all attachments as: .zip

Change History (23)

@blobfolio
7 years ago

Add flac to the default wp_get_mime_types() list.

#1 @blobfolio
7 years ago

  • Keywords has-patch 2nd-opinion added

@blobfolio
7 years ago

Add flac to ext2type and wp_audio_extensions defaults.

#2 @joemcgill
7 years ago

  • Milestone changed from Awaiting Review to 4.9.1

This looks good, but unfortunately missed the 4.9 deadline. Let's get this in for 4.9.1.

#3 follow-up: @wonderboymusic
7 years ago

  • Keywords 2nd-opinion removed

what do these files look like when used with MediaElement? wp_audio_extensions filter mainly exists to whitelist ME-capable types

@blobfolio
7 years ago

Just a refresh built against the current source.

@blobfolio
7 years ago

Picture showing embedded Flac media

#4 in reply to: ↑ 3 @blobfolio
7 years ago

Replying to wonderboymusic:

what do these files look like when used with MediaElement? wp_audio_extensions filter mainly exists to whitelist ME-capable types

I attached a screenshot. ME.js draws the usual widget. The raw HTML looks like it should too.

#5 @johnbillion
7 years ago

  • Milestone changed from 4.9.1 to 4.9.2

@blobfolio
7 years ago

Another refresh. :)

This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.


7 years ago

#7 @joemcgill
7 years ago

  • Keywords needs-unit-tests added

42225.4.diff is looking good to me. It would be nice to update/add unit tests here where it makes sense, otherwise it's ready to go in.

@blobfolio
7 years ago

Add unit test.

@blobfolio
7 years ago

File for unit tests, place in tests/phpunit/data/uploads/

@blobfolio
7 years ago

Move unit test to "Test a few additional file types on single sites." block; seems more appropriate.

#8 @blobfolio
7 years ago

  • Keywords needs-unit-tests removed

I added a unit test to make sure Flac files get through wp_check_filetype_and_ext() under default conditions.

This ticket was mentioned in Slack in #core-media by mike. View the logs.


7 years ago

This ticket was mentioned in Slack in #core-media by blobfolio. View the logs.


7 years ago

This ticket was mentioned in Slack in #core-media by mike. View the logs.


7 years ago

#12 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 42451:

Media: Add flac to the list of allowed file types.

Props blobfolio.
Fixes #42225.

#13 @SergeyBiryukov
7 years ago

In 42452:

Media: Add flac to the list of allowed file types.

Props blobfolio.
Merges [42451] to the 4.9 branch.
Fixes #42225.

#14 @SergeyBiryukov
7 years ago

In 42453:

Media: Add small-audio.flac for a unit test added in [42451].

See #42225.

#15 @SergeyBiryukov
7 years ago

In 42454:

Media: Add small-audio.flac for a unit test added in [42451].

Merges [42453] to the 4.9 branch.
See #42225.

Note: See TracTickets for help on using tickets.