[wp-trac] [WordPress Trac] #60610: Consider fixing user mistakes and/or adding unit tests for $preferred_ext in wp_mime_type_icon()
WordPress Trac
noreply at wordpress.org
Thu Feb 22 19:39:29 UTC 2024
#60610: Consider fixing user mistakes and/or adding unit tests for $preferred_ext
in wp_mime_type_icon()
-------------------------+-----------------------------
Reporter: sabernhardt | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60610>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list