WordPress.org

Make WordPress Core

Ticket #19800: 19800.check-copy.diff

File 19800.check-copy.diff, 575 bytes (added by duck_, 2 years ago)
  • wp-admin/includes/file.php

     
    345345 
    346346        // Copy the temporary file into its destination 
    347347        $new_file = $uploads['path'] . "/$filename"; 
    348         copy( $tmp_file, $new_file ); 
     348        if ( false === copy( $tmp_file, $new_file ) ) 
     349                return $upload_error_handler( $file, sprintf( __('The uploaded file could not be moved to %s.' ), $uploads['path'] ) ); 
    349350        unlink($tmp_file); 
    350351 
    351352        // Set correct file permissions