Make WordPress Core

Opened 2 months ago

Last modified 7 weeks ago

#60610 accepted enhancement

Consider fixing user mistakes and/or adding unit tests for $preferred_ext in wp_mime_type_icon()

Reported by: sabernhardt's profile sabernhardt Owned by: joedolson's profile joedolson
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.5
Component: Media Keywords:
Focuses: Cc:

Description

Follow-up to ticket:31352#comment:54

The $preferred_ext value for wp_mime_type_icon() begins with a period, and developers might miss that. The function could check the first character and add the dot if it does not exist there. The function also could ensure that the letters are lowercase.

For unit tests, the test_wp_mime_type_icon_video test in post/attachments.php checks the default $preferred_ext parameter value. Adding at least one more test with a specific $preferred_ext could help.

Change History (2)

#1 @joedolson
7 weeks ago

  • Milestone changed from Awaiting Review to 6.6
  • Owner set to joedolson
  • Status changed from new to accepted

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


7 weeks ago

Note: See TracTickets for help on using tickets.