[wp-trac] [WordPress Trac] #39875: PDF previews overwrite existing images with the same name.

WordPress Trac noreply at wordpress.org
Fri Feb 24 05:40:53 UTC 2017


#39875: PDF previews overwrite existing images with the same name.
-------------------------------------+--------------------
 Reporter:  gitlost                  |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  4.7.3
Component:  Media                    |     Version:  4.7
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+--------------------

Comment (by dd32):

 > I still see no reason for using a random string.

 I can't see a need for it either, lets just use `wp_unique_filename()`
 here, in most cases it'll not conflict with anything and be used straight
 up - but in the event another plugin has created the file, or the user
 uploaded a conflicting name, it'll cause it to not overwrite something
 that exists already. `-pdf2.jpg` would work fine - afterall the filename
 will be stored in the DB, no code in core is ever going to base decisions
 off the filesystem alone.

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


More information about the wp-trac mailing list