[wp-trac] [WordPress Trac] #30394: Multiple edits with IMAGE_EDIT_OVERWRITE define enabled causes deletion of images

WordPress Trac noreply at wordpress.org
Thu Dec 4 10:22:46 UTC 2014


#30394: Multiple edits with IMAGE_EDIT_OVERWRITE define enabled causes deletion of
images
--------------------------+-----------------------------
 Reporter:  hew           |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Media         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+-----------------------------
Changes (by johnbillion):

 * keywords:   => has-patch
 * milestone:  Awaiting Review => Future Release


Old description:

> The ```update_attached_file()``` call in ```wp_save_image()``` (``` wp-
> admin/includes/image-edit.php```) fails when IMAGE_EDIT_OVERWRITE is
> enabled because the underlying ```update_meta_value()``` call has a
> ```meta_value``` (file path) that matches the value already in the DB.
>
> ```$success = update_attached_file( $post_id, $new_path );```
>
> The failure there leads to subsequent file deletion at the end of
> ```wp_save_image()```.
>
> ```@unlink( $delpath );```
>
> Likely related in some way: #30167

New description:

 The `update_attached_file()` call in `wp_save_image()` (`wp-admin/includes
 /image-edit.php`) fails when IMAGE_EDIT_OVERWRITE is enabled because the
 underlying `update_meta_value()` call has a `meta_value` (file path) that
 matches the value already in the DB.

 `$success = update_attached_file( $post_id, $new_path );`

 The failure there leads to subsequent file deletion at the end of
 `wp_save_image()`.

 `@unlink( $delpath );`

 Likely related in some way: #30167

--

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


More information about the wp-trac mailing list