Opened 13 years ago
Closed 13 years ago
#20666 closed defect (bug) (fixed)
Custom header image cropping can create identical attachments
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description
- Add an image to Media Library which requires cropping.
- Go to Appearance → Header, click "Choose from image library".
- Select the image from point 1, click "Set as header", "Crop and Publish".
- Press browser's Back button, click "Crop and Publish" once again.
- Delete one of the two identical "Header Image" attachments in Media Library.
- The other attachment is now orphaned (the files are deleted in point 5).
Sounds like wp_unique_filename()
should be used in there somewhere.
Attachments (2)
Change History (7)
#3
@
13 years ago
20666.2.patch fixes the line placement (should be after wp_mkdir_p()
).
#4
in reply to:
↑ 2
@
13 years ago
Replying to ryan:
Perhaps we should also call wp_upload_dir() to get a newly dated upload dir instead of reusing the old dir when cropping an existing image from the media library.
step_3()
in wp-admin/custom-header.php
would still expect the new attachment to be in the same directory as the original file:
http://core.trac.wordpress.org/browser/trunk/wp-admin/custom-header.php?rev=20769#L877
Note: See
TracTickets for help on using
tickets.
Perhaps we should also call wp_upload_dir() to get a newly dated upload dir instead of reusing the old dir when cropping an existing image from the media library.