Opened 3 months ago
Closed 6 weeks ago
#59277 closed defect (bug) (duplicate)
Bug: wp_check_filetype_and_ext returns type and ext as false for font files
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.7.3 |
Component: | Upload | Keywords: | |
Focuses: | Cc: |
Description
the function wp_check_filetype_and_ext
returns both type
and ext
as false for font files (.ttf, .woff, .woff2 etc..)
This is because the $real_mime
for the font files is application/octet-stream
and the following condition has no check for font mimes. (font/ttf
, font/woff
)
// file: src/wp-includes/functions.php // line: 3184 if ( in_array( $real_mime, $nonspecific_types, true ) ) { if ( ! in_array( substr( $type, 0, strcspn( $type, '/' ) ), array( 'application', 'video', 'audio' ), true ) ) { $type = false; $ext = false; } }
Change History (2)
Note: See
TracTickets for help on using
tickets.
Hello @madhudollu,
Welcome back to WordPress Core's Trac :)
#40175 is tracking upload validation and mime handling. Let's continue the discussion there.