[wp-trac] [WordPress Trac] #42437: Thumbnails can overwrite other uploads if filename matches
WordPress Trac
noreply at wordpress.org
Thu Dec 5 01:47:58 UTC 2019
#42437: Thumbnails can overwrite other uploads if filename matches
--------------------------+-----------------------
Reporter: Viper007Bond | Owner: pbiron
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.3.1
Component: Upload | Version: 4.8.3
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+-----------------------
Comment (by azaozz):
Replying to [comment:37 pbiron]:
> 1 was your idea :-)
Hehe, yes, just thinking more about it now :)
> Not sure what you mean by "callback" in this context. But, yes, could
probably be sped up...especially when `get_option(
'uploads_use_yearmonth_folders' )` returns false.
Yeah, did some quick speed testing and `array_filter()` is slightly faster
when there are less than 200-250 files in the uploads dir. For more files
the `foreach` loop starts to get a bit faster especially if a match is
found near the top. Generally the difference is negligible, the "slowness"
there comes from the callback function/regex.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42437#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list