[wp-trac] [WordPress Trac] #48974: -1 being added to image uploads with Version 5.3.1

WordPress Trac noreply at wordpress.org
Sat Dec 14 21:46:27 UTC 2019


#48974: -1 being added to image uploads with Version 5.3.1
-------------------------------+------------------------------
 Reporter:  neotrope           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  General            |     Version:  5.3.1
 Severity:  normal             |  Resolution:
 Keywords:  needs-patch close  |     Focuses:
-------------------------------+------------------------------

Comment (by pbiron):

 Replying to [comment:5 neotrope]:
 > Right - but the filename is unique to begin with and should not be
 rewritten as the base file being used inside a post for a newspaper with
 internal versioning and backup merges, where now we would have duplicate
 versions of every image.

 The filename may be unique **at the time you upload it** (including for
 the auto-generated sub-sizes that exist **at the the time you upload it**,
 but as general purpose software, WP must consider the ''future''...if you
 were to later change themes to one that defined a sub-size that was
 `696x522` and then you uploaded an image named `19-1216-iskysoft-
 christmas19.jpg` WP would overwrite the file you originally uploaded as
 `19-1216-iskysoft-christmas19-696x522.jpg`.  And while **your workflow**
 may prevent that from happening, many WP users **do** change themes (or
 activate plugins) define different sub-sizes and then regenerate sub-sizes
 for existing uploads and were having previously uploaded files
 overwritten.

 So, this change was to solve a problem that real users were having.

 > So, having to use a plugin simply to keep the original filename is
 incredibly stupid.
 >
 > No CMS should change the names of original intellectual property files
 -- this is contrary to good behavior. -1 on the primary image should only
 be done if in fact there were a duplicate, which we have not had since
 using WP since 2004.

 As I stated before, WP has (since **at least version 2.5.0**) sometimes
 changed the names of original files upon upload to prevent previously (or
 future) uploaded files from being overwritten.

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


More information about the wp-trac mailing list