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

WordPress Trac noreply at wordpress.org
Sun Feb 26 21:49:08 UTC 2017


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

Comment (by joemcgill):

 Thansk @desrosj and @gitlost. I agree that using `pathinfo()` and
 `wp_basename()` is an improvement over `preg_replace()` in this case. The
 second unit test in [attachment:39875.3.patch] looks helpful in terms of
 checking the logic there, but unless we intend to abstract that out into a
 new function, I'd rather leave that test out.

 [attachment:39875.4.patch] Simplifies the unit tests from
 [attachment:39875.3.patch] a bit, but should be identical otherwise. I
 don't think we need to test that the attachments and metadata were
 generated correctly in this test, that functionality should be tested
 elsewhere. If it isn't, we should add additional unit test coverage that
 is focussed specifically on that functionality.

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


More information about the wp-trac mailing list