Make WordPress Core

Opened 13 months ago

Last modified 8 months ago

#52181 new defect (bug)

wrong mimetime for gzip files

Reported by: liedekef Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.6
Component: Media Keywords: has-patch
Focuses: Cc:


In the file wp-includes/functions.php, function wp_get_mime_types(), the mimetype for gz|gzip is indicated as "application/x-gzip", while fileinfo (and /etc/mimetypes) return "application/gzip".

Also, it seems this line is missing tgz, so I would suggest changing this from:

'gz|gzip'                      => 'application/x-gzip',


'gz|gzip|tgz'                      => 'application/gzip',

Attachments (3)

52181.diff (704 bytes) - added by mukesh27 13 months ago.
52181.2.patch (3.8 KB) - added by Mista-Flo 12 months ago.
52181.3.patch (1.2 KB) - added by Mista-Flo 12 months ago.

Download all attachments as: .zip

Change History (11)

#1 @SergeyBiryukov
13 months ago

  • Component changed from General to Media

13 months ago


#2 @mukesh27
13 months ago

  • Keywords has-patch added

Hi there! Thanks for the ticket.

As per this thread https://superuser.com/questions/901962/what-is-the-correct-mime-type-for-a-tar-gz-file tgz in application/gzip mime type.

Please check the handbook page for creating the patch from src/ https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/

#4 @Mista-Flo
12 months ago

Hey guys, patch looks good, thanks.

I have just updated it to tweak unit test with the new value.

12 months ago

12 months ago


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

11 months ago

#6 @antpb
11 months ago

  • Milestone changed from Awaiting Review to 5.8

Mentioned in the recent Media Component meeting, this looks like a good ticket for 5.8. Adding to the milestone for visibility.

This ticket was mentioned in Slack in #core by chaion07. View the logs.

8 months ago

#8 @chaion07
8 months ago

  • Milestone changed from 5.8 to Future Release

Thanks to @liedekef for reporting this. We recently reviewed this during a recent [bug-scrub session]https://wordpress.slack.com/archives/C02RQBWTW/p1623097314362900. With Beta 1 coming up in a day this could be a good one for future releases. Milestone updated. Thanks

Note: See TracTickets for help on using tickets.