[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:19:27 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:
------------------------------------------------+---------------------
Changes (by SergeyBiryukov):
* keywords: => needs-patch php81 needs-unit-tests
* milestone: Awaiting Review => 6.3
Comment:
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Just noting that this previously came up in comment:49:ticket:50913, and
[49049] / #50913 added `application/csv` to the list of supported types in
`wp_check_filetype_and_ext()`, so that it works as expected on PHP 8.0.
While the `text/csv` type is technically allowed as of [44438] / #45615,
it looks like the function may need a new conditional to check for it
properly, similar to the one added for `application/csv` in [49049].
The unit tests might need some updates too if there is currently an issue
with `text/csv` that they don't catch.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58094#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list