[wp-trac] [WordPress Trac] #35755: wp_tempnam produces filenames longer than 255 characters
WordPress Trac
noreply at wordpress.org
Sat Jul 1 12:54:08 UTC 2023
#35755: wp_tempnam produces filenames longer than 255 characters
---------------------------------------------------+---------------------
Reporter: doems | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.3
Component: Filesystem API | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests dev-feedback | Focuses:
---------------------------------------------------+---------------------
Comment (by oglekler):
@costdev you wrote on the PR that wp_unique_filename() is called a second
time after cutting the filename, but calling a function a second time
doesn't look like an optimal scenario. So, I believe that a better
approach will be to check name length and cut it if needed, and only then
call wp_unique_filename() once. If check of file length and cutting will
be moved to another function, it will be accessible to use in other
places.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35755#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list