[wp-trac] [WordPress Trac] #53668: Generated images for one file can be overwritten by another with the same name when mapping mime types for generated images

WordPress Trac noreply at wordpress.org
Tue Aug 17 20:54:53 UTC 2021


#53668: Generated images for one file can be overwritten by another with the same
name when mapping mime types for generated images
----------------------------------------------------+---------------------
 Reporter:  ianmjones                               |       Owner:  (none)
     Type:  defect (bug)                            |      Status:  new
 Priority:  normal                                  |   Milestone:  5.8.1
Component:  Media                                   |     Version:  5.8
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch needs-testing has-unit-tests  |     Focuses:
----------------------------------------------------+---------------------

Comment (by azaozz):

 Replying to [comment:28 ianmjones]:
 > ... bingo! Adding the alternative filenames that a filter implementer
 could check against would really help. :)

 Okay, lets add that :)

 > we could quickly check our records of offloaded filenames for the same
 dir to see whether there's a clash and do the usual version bump we do.

 That would need another run through `wp_unique_filename()`, right?
 Probably quite rarely.

 Wondering what would be better:
 1. A filter for `$new_number` inside the loop where the alt filenames are
 checked.
 2. The array of the alt filenames (and perhaps $number?) in the closing
 `wp_unique_filename` filter.

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


More information about the wp-trac mailing list