Make WordPress Core


Ignore:
Timestamp:
01/04/2015 02:51:20 AM (10 years ago)
Author:
wonderboymusic
Message:

If IMAGE_EDIT_OVERWRITE is defined as true, ensure that multiple edits to the same image does not result in the file being deleted (updating the meta fails because the old and new paths are identical).

Props hew.
Fixes #30394.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image-edit.php

    r30644 r31043  
    749749            $backup_sizes[$tag] = array('width' => $meta['width'], 'height' => $meta['height'], 'file' => $path_parts['basename']);
    750750
    751         $success = update_attached_file( $post_id, $new_path );
     751        $success = ( $path === $new_path ) || update_attached_file( $post_id, $new_path );
    752752
    753753        $meta['file'] = _wp_relative_upload_path( $new_path );
Note: See TracChangeset for help on using the changeset viewer.