[wp-trac] [WordPress Trac] #58094: CSV files are prevented in PHP 8.1. due to wp_check_filetype_and_ext()

WordPress Trac noreply at wordpress.org
Wed Apr 5 21:43:42 UTC 2023


#58094: CSV files are prevented in PHP 8.1. due to wp_check_filetype_and_ext()
------------------------------------------------+---------------------
 Reporter:  bradshawtm                          |       Owner:  (none)
     Type:  defect (bug)                        |      Status:  new
 Priority:  normal                              |   Milestone:  6.3
Component:  Upload                              |     Version:  6.2
 Severity:  minor                               |  Resolution:
 Keywords:  needs-patch php81 needs-unit-tests  |     Focuses:
------------------------------------------------+---------------------

Comment (by bradshawtm):

 > While the text/csv type is technically allowed

 Yes, it's recognised in the code as a valid mime type, but the piece
 that's missing is that it needs a similar check to the one added in
 [49049], line 2947, since `finfo_file()` gives `text/csv` in PHP 8.1 and
 thus doesn't match any of the other checks.

 Thanks!

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


More information about the wp-trac mailing list