Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#25261 closed enhancement (duplicate)

Improve wp_ext2type() to support image file extensions

Reported by: jonnyauk's profile Jonnyauk Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.6
Component: Media Keywords: has-patch
Focuses: Cc:


In wp-includes/functions.php there is potential to improve the wp_ext2type() function. It currently doesn't recognise image file extensions.

Although there is a filter available in this function ('ext2type') to use, I'd imagine expected behaviour would be native support for image file extensions without interacting with this filter.

I've attached a simple patch that addresses this - will return 'image' for file extensions 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' (core allowed image filetypes).

Attachments (1)

25261-v1.patch (823 bytes) - added by Jonnyauk 9 years ago.
Patch to add image file extensions

Download all attachments as: .zip

Change History (3)

9 years ago

Patch to add image file extensions

#1 @SergeyBiryukov
9 years ago

  • Keywords 2nd-opinion removed
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #25176.

#2 @SergeyBiryukov
9 years ago

  • Version changed from trunk to 3.6
Note: See TracTickets for help on using tickets.