Make WordPress Core

Changeset 21039


Ignore:
Timestamp:
06/10/2012 01:26:12 AM (12 years ago)
Author:
ryan
Message:

Make sure the path exists before copying. see #20657

File:
1 edited

Legend:

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

    r20978 r21039  
    449449        $dst_file = str_replace( basename( $dst_file ), 'copy-' . basename( $dst_file ), $dst_file );
    450450        $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) );
     451
     452        // The directory containing the original file may no longer exist when
     453        // using a replication plugin.
     454        wp_mkdir_p( dirname( $dst_file ) );
     455
    451456        if ( ! @copy( $src_file, $dst_file ) )
    452457            $dst_file = false;
Note: See TracChangeset for help on using the changeset viewer.