[wp-trac] [WordPress Trac] #33227: "Delete Permantently" Only Deletes Original Size (UTF-8 file names)
WordPress Trac
noreply at wordpress.org
Wed Feb 1 02:01:46 UTC 2017
#33227: "Delete Permantently" Only Deletes Original Size (UTF-8 file names)
-------------------------------------------+-----------------------------
Reporter: pavelevap | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Media | Version: 4.1
Severity: normal | Resolution:
Keywords: needs-patch reporter-feedback | Focuses:
-------------------------------------------+-----------------------------
Comment (by gitlost):
As also reported in #39039, this is the same locale-dependent `basename()`
bug as #21217 and #23267 and various others. The following patch fixes it
for this instance, but from what I can see there's around 90 other
instances of `basename()` and `PATHINFO_BASENAME` throughout the code base
which should also use `wp_basename()` instead, so perhaps a new general
"audit" ticket should be raised for them?
The patch changes `basename()` to `wp_basename()` in
`wp_delete_attachment()` only, including the `$meta['thumb']` branch use,
though not sure how it arises or how to test it. The patch also fixes the
`Tests_Post_Attachments::test_insert_image_delete()` test which wasn't
checking the non-existence of deleted files correctly.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33227#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list