[wp-trac] [WordPress Trac] #42437: Thumbnails can overwrite other uploads if filename matches

WordPress Trac noreply at wordpress.org
Fri Nov 22 00:53:24 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 pbiron):

 @azaozz I'm working on a revised patch for this.

 Where do you think is the best place to do this "extra" collision
 detection?  My original patch does it in `_wp_handle_upload()`, but I'm
 wondering whether it would be better to do it in `wp_unique_filename()`.

 The question is: `wp_unique_filename()` is called in a few places where
 it's a little hard for me to wrap my head around whether there would be
 unintended consequences if it where there.  For example,
 `wp_crop_image()`, `wp_generate_attachment_metadata()`,
 `_copy_image_file()`, `wp_tempnam()`.

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


More information about the wp-trac mailing list