WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 21 months ago

#25261 closed enhancement (duplicate)

Improve wp_ext2type() to support image file extensions

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

Description

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 2 years ago.
Patch to add image file extensions

Download all attachments as: .zip

Change History (3)

@Jonnyauk2 years ago

Patch to add image file extensions

comment:1 @SergeyBiryukov2 years ago

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

Duplicate of #25176.

comment:2 @SergeyBiryukov21 months ago

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