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

WordPress Trac noreply at wordpress.org
Wed May 16 14:47:52 UTC 2018


#42437: Thumbnails can overwrite other uploads if filename matches
--------------------------+-----------------------------
 Reporter:  Viper007Bond  |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Upload        |     Version:  4.8.3
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------------

Comment (by pbiron):

 Replying to [comment:16 azaozz]:
 > How about [#comment:5 my other idea]: if the original file name ends
 with something like `-600x800.jpg` rename it and append `-1`, `-2`, etc.
 the same way we do for all other naming conflicts in WP.
 >
 > This will give us file names like `sunset-150x150-1.jpg`, `sundown-
 150x150-2.jpg` or `here-comes-the-night-150x150-1.jpg` (the same names you
 will get if you upload the same image several times). These names are a
 lot more "readable" and close to the original than something like `sunset-
 27624fea676d86f7-150x150.jpg` for subsizes.

 I just did a few tests on pathological cases with this idea implemented
 and it seems to work great.  Look for a proof-of-concept patch shortly.

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


More information about the wp-trac mailing list