[wp-trac] [WordPress Trac] #58349: TypeError in wp_check_filetype_and_ext hook: bool values into $mimes argument can be passed

WordPress Trac noreply at wordpress.org
Thu May 18 08:28:16 UTC 2023


#58349: TypeError in wp_check_filetype_and_ext hook: bool values into $mimes
argument can be passed
----------------------------------------+---------------------
 Reporter:  platonkristinin             |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  6.3
Component:  Media                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+---------------------
Changes (by johnbillion):

 * keywords:   => needs-patch good-first-bug
 * component:  General => Media
 * milestone:  Awaiting Review => 6.3


Comment:

 Thanks for the report. It does indeed seem that `false` can get passed to
 the `$mimes` parameter, which is incorrect. This parameter should be an
 array of strings or `null`.

 Ref: https://github.com/WordPress/wordpress-
 develop/blob/261ab3fa5de7b1972dd52e938cdb4abd8d9014df/src/wp-
 admin/includes/file.php#L931 . `$mimes` has a fallback of `false` here
 when it should be `null`: https://github.com/WordPress/wordpress-
 develop/blob/261ab3fa5de7b1972dd52e938cdb4abd8d9014df/src/wp-
 admin/includes/file.php#L893.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58349#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list