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

WordPress Trac noreply at wordpress.org
Thu Dec 5 18:31:49 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:  has-patch needs-testing needs-unit-  |     Focuses:
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by azaozz):

 Replying to [comment:42 pbiron]:
 I agree. This is a "far fetched" edge case but since we're trying to fix
 "all" cases, perhaps good to account for it too :)

 > After step 5, you'll see that the original of ''image-140x140.jpg'' has
 been overwritten by the thumbnail sub-size of ''image.jpg''.

 Yeah, the logic behind  "Add a number to any file that could cause a
 collision with sub-sizes." is to rename files when the original name ends
 with a "WP reserved" string. Perhaps we can look into doing this only for
 supported image files, i.e. `.png`, `.gif`, `.jpg`, `.jpeg` and/or
 "formalize" that list of reserved file name endings.

 For 5.3.1 thinking it would be enough to hard-code this. Revised patch
 coming up.

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


More information about the wp-trac mailing list